Skip to content

Commit f9d2bba

Browse files
committed
change respond closure to propogate errors up
1 parent 4c42b1f commit f9d2bba

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/iface/interface.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1084,18 +1084,21 @@ impl<'a> Interface<'a> {
10841084
match device.transmit().ok_or(Error::Exhausted) {
10851085
Ok(_t) => {
10861086
#[cfg(feature = "proto-sixlowpan-fragmentation")]
1087-
if let Err(_e) = inner.dispatch_ip(_t, response, Some(_out_packets)) {
1088-
net_debug!("failed to dispatch IP: {}", _e);
1087+
if let Err(e) = inner.dispatch_ip(_t, response, Some(_out_packets)) {
1088+
net_debug!("failed to dispatch IP: {}", e);
1089+
return Err(e);
10891090
}
10901091

10911092
#[cfg(not(feature = "proto-sixlowpan-fragmentation"))]
1092-
if let Err(_e) = inner.dispatch_ip(_t, response, None) {
1093-
net_debug!("failed to dispatch IP: {}", _e);
1093+
if let Err(e) = inner.dispatch_ip(_t, response, None) {
1094+
net_debug!("failed to dispatch IP: {}", e);
1095+
return Err(e);
10941096
}
10951097
emitted_any = true;
10961098
}
10971099
Err(e) => {
10981100
net_debug!("failed to transmit IP: {}", e);
1101+
return Err(e);
10991102
}
11001103
}
11011104

0 commit comments

Comments
 (0)