From f9b90fb354d76c45acc135ad3b64a0c59677fdf2 Mon Sep 17 00:00:00 2001 From: Lee Smet Date: Tue, 26 Mar 2024 14:50:49 +0100 Subject: [PATCH] Allow retractions for subnet from any router-id Signed-off-by: Lee Smet --- CHANGELOG.md | 1 + src/filters.rs | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8879e461..67da3bd6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Size of data packets is limited to 65535 bytes. - Update interval is now expressed as centiseconds, in accordance with the babel RFC. +- Update filters now allow retractions for a route from any router-id. ### Fixed diff --git a/src/filters.rs b/src/filters.rs index 35b7123d..516aeb04 100644 --- a/src/filters.rs +++ b/src/filters.rs @@ -38,12 +38,16 @@ impl RouteUpdateFilter for AllowedSubnet { } /// Limit the announced subnets to those which contain the derived IP from the `RouterId`. +/// +/// Since retractions can be sent by any node to indicate they don't have a route for the subnet, +/// these are also allowed. pub struct RouterIdOwnsSubnet; impl RouteUpdateFilter for RouterIdOwnsSubnet { fn allow(&self, update: &babel::Update) -> bool { - update - .subnet() - .contains_ip(update.router_id().to_pubkey().address().into()) + update.metric().is_infinite() + || update + .subnet() + .contains_ip(update.router_id().to_pubkey().address().into()) } }