Fall back to all known peers to send seqno

In case the route is not known at all (this could happen in rare cases
were a seqno request is forwarded from a peer, for instance), the
request would be silently dropped. Know we shell out to all known peers.

Signed-off-by: Lee Smet <lee.smet@hotmail.com>
This commit is contained in:
Lee Smet committed 2024-06-04 14:10:24 +02:00
1 parent 3975a23e6c
commit 7c637ff2bb
2 files changed
+28 -12

No files matched your search

Generated
+2
View File
@@ -1055,6 +1055,7 @@ dependencies = [
"left-right",
"libc",
"netdev",
"nix 0.28.0",
"nix 0.29.0",
"openssl",
"quinn",
@@ -1217,6 +1218,7 @@ dependencies = [
"cfg-if",
"cfg_aliases 0.1.1",
"libc",
"memoffset",
]
[[package]]
+26 -12
View File
@@ -1278,7 +1278,8 @@ where
vec![target]
} else {
// If we don't have a dedicated peer to send to, just send to every peer which
// announced the subnet. But avoid repetitions.
// announced the subnet. But avoid repetitions. Additionally, if we don't have any
// peer which announced the subnet (because all anounces are unfeasible)
let mut peers_sent = vec![];
if let Some((last_sent, visited)) = seqno_info {
// If it's more than some time since we last sent an update to any peer for this
@@ -1289,20 +1290,33 @@ where
}
};
self.inner_r
let known_routes = self
.inner_r
.enter()
.expect("Write handle is saved on router so this read always succeeds; qed")
.routing_table
.entries(source.subnet())
.into_iter()
.filter_map(|re| {
if !peers_sent.contains(re.neighbour()) {
Some(re.neighbour().clone())
} else {
None
}
})
.collect()
.entries(source.subnet());
if known_routes.is_empty() {
// If we don't know the route just ask all our peers
self.peer_interfaces
.read()
.unwrap()
.iter()
.cloned()
.collect()
} else {
known_routes
.into_iter()
.filter_map(|re| {
if !peers_sent.contains(re.neighbour()) {
Some(re.neighbour().clone())
} else {
None
}
})
.collect()
}
};
for peer in targets {