mirror of
https://github.com/threefoldtech/mycelium.git
synced 2026-10-23 06:01:16 +00:00
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:
1 file changed
+1
-2
+1
-2
@@ -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),
|
||||
|
||||
Reference in new issue
Block a user