Update source table only on seqno increase

The previous condition updated the source table unconditionally if the
new seqno was not less than the existing source key seqno. This is not
correct however, as it also updates the source key if the seqno is
the same, thus allowing the source key metric to increase for the same
seqno. This allows for loops to be created, as an update could increase
the metric, after which a loop update could eronously be accepted.

Fixes #176

Signed-off-by: Lee Smet <lee.smet@hotmail.com>
This commit is contained in:
Lee Smet committed 2024-03-25 14:02:36 +01:00
1 parent 4a3f4cf2cb
commit 515f0470e8
1 file changed
+1 -2
+1 -2
View File
@@ -1228,10 +1228,9 @@ impl RouterInner {
let source_key = SourceKey::new(subnet, router_id);
// Nothing to do on route retraction.
if let Some(source_entry) = source_table.get(&source_key) {
// if seqno of the update is greater than the seqno in the source table, update the source table
if !seqno.lt(&source_entry.seqno()) {
if seqno.gt(&source_entry.seqno()) {
source_table.insert(
source_key,
FeasibilityDistance::new(metric, seqno),