Skip to content

Commit d04e268

Browse files
Merge #666
666: change `respond` closure in `Interface::socket_egress` to propogate errors up r=Dirbaio a=ritikmishra On a hardware device, I was running into an issue where the device transmit buffer was filling up, so it was no longer issuing `TxToken`s. However, `smoltcp` was ignoring that error, so we were observing that our packets were not being sent. Propagating the error up fixed this problem Co-authored-by: Ritik Mishra <ritik@moveparallel.com>
2 parents 4c42b1f + f9d2bba commit d04e268

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)