Allow for ARP retry during egress
This commit is contained in:
parent
6a38ace62c
commit
24e4868761
|
@ -578,7 +578,7 @@ impl<'b, 'c, 'e, DeviceT> Interface<'b, 'c, 'e, DeviceT>
|
||||||
|
|
||||||
let mut emitted_any = false;
|
let mut emitted_any = false;
|
||||||
for mut socket in sockets.iter_mut() {
|
for mut socket in sockets.iter_mut() {
|
||||||
if !socket.meta_mut().egress_permitted(|ip_addr|
|
if !socket.meta_mut().egress_permitted(timestamp, |ip_addr|
|
||||||
self.inner.has_neighbor(&ip_addr, timestamp)) {
|
self.inner.has_neighbor(&ip_addr, timestamp)) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,18 +58,21 @@ impl Meta {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn egress_permitted<F>(&mut self, has_neighbor: F) -> bool
|
pub(crate) fn egress_permitted<F>(&mut self, timestamp: Instant, has_neighbor: F) -> bool
|
||||||
where F: Fn(IpAddress) -> bool
|
where F: Fn(IpAddress) -> bool
|
||||||
{
|
{
|
||||||
match self.neighbor_state {
|
match self.neighbor_state {
|
||||||
NeighborState::Active =>
|
NeighborState::Active =>
|
||||||
true,
|
true,
|
||||||
NeighborState::Waiting { neighbor, .. } => {
|
NeighborState::Waiting { neighbor, silent_until } => {
|
||||||
if has_neighbor(neighbor) {
|
if has_neighbor(neighbor) {
|
||||||
net_trace!("{}: neighbor {} discovered, unsilencing",
|
net_trace!("{}: neighbor {} discovered, unsilencing",
|
||||||
self.handle, neighbor);
|
self.handle, neighbor);
|
||||||
self.neighbor_state = NeighborState::Active;
|
self.neighbor_state = NeighborState::Active;
|
||||||
true
|
true
|
||||||
|
} else if timestamp > silent_until {
|
||||||
|
net_trace!("{}: Retrying egress for neighbor {}", self.handle, neighbor);
|
||||||
|
true
|
||||||
} else {
|
} else {
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue