Make `Error::Unaddressable` ignored for ICMP sockets as well.
This commit is contained in:
parent
eb7d0e346e
commit
1e809daf7a
|
@ -227,11 +227,13 @@ impl<'b, 'c, DeviceT> Interface<'b, 'c, DeviceT>
|
||||||
Socket::Icmp(ref mut socket) =>
|
Socket::Icmp(ref mut socket) =>
|
||||||
socket.dispatch(&caps, |response| {
|
socket.dispatch(&caps, |response| {
|
||||||
let tx_token = device.transmit().ok_or(Error::Exhausted)?;
|
let tx_token = device.transmit().ok_or(Error::Exhausted)?;
|
||||||
match response {
|
device_result = match response {
|
||||||
(IpRepr::Ipv4(repr), icmp_repr) =>
|
(IpRepr::Ipv4(ipv4_repr), icmpv4_repr) =>
|
||||||
inner.dispatch(tx_token, timestamp, Packet::Icmpv4((repr, icmp_repr))),
|
inner.dispatch(tx_token, timestamp,
|
||||||
|
Packet::Icmpv4((ipv4_repr, icmpv4_repr))),
|
||||||
_ => Err(Error::Unaddressable),
|
_ => Err(Error::Unaddressable),
|
||||||
}
|
};
|
||||||
|
device_result
|
||||||
}),
|
}),
|
||||||
#[cfg(feature = "socket-udp")]
|
#[cfg(feature = "socket-udp")]
|
||||||
Socket::Udp(ref mut socket) =>
|
Socket::Udp(ref mut socket) =>
|
||||||
|
|
Loading…
Reference in New Issue