Skip to content

Commit

Permalink
Allow retractions for subnet from any router-id
Browse files Browse the repository at this point in the history
Signed-off-by: Lee Smet <[email protected]>
  • Loading branch information
LeeSmet committed Mar 26, 2024
1 parent 02c00e6 commit f9b90fb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
10 changes: 7 additions & 3 deletions src/filters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}
}

0 comments on commit f9b90fb

Please sign in to comment.