fix: implement conditional mandatory BGP attribute validation#281
Merged
digizeph merged 6 commits intobgpkit:mainfrom Apr 15, 2026
Merged
fix: implement conditional mandatory BGP attribute validation#281digizeph merged 6 commits intobgpkit:mainfrom
digizeph merged 6 commits intobgpkit:mainfrom
Conversation
Update attribute verification to follow RFC 4760 (MP-BGP) rules where mandatory attributes depend on the message payload. - pure withdrawal (withdrawn routes or MP_UNREACH_NLRI) -> none. - ORIGIN + AS_PATH for announcements - NEXT_HOP: conditional. IPv4 NLRI present -> required, IPv4 NLRI not - present -> should be omitted. Optimisation: the [bool; 256] tracking array is now a [u64; 4] bitmask.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #281 +/- ##
==========================================
+ Coverage 90.53% 90.60% +0.06%
==========================================
Files 84 84
Lines 15835 15897 +62
==========================================
+ Hits 14336 14403 +67
+ Misses 1499 1494 -5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
Author
The check is not correct atm (Mixed case of IPv4 + IPv6 is not checked correctly). |
…ning Fixes build failure caused by missing attr_mask field in the serde Deserialize implementation for Attributes. The mask is now computed from the deserialized inner attribute vector. Also collapses nested if statements to address clippy warning. Changes: - src/models/bgp/attributes/mod.rs: Fix Deserialize impl and clippy - CHANGELOG.md: Document RFC 4760 validation changes
6bf9d9c to
6679abf
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Update attribute verification to follow RFC 4760 (MP-BGP) rules where mandatory attributes depend on the message payload.
Optimisation: the [bool; 256] tracking array is now a [u64; 4] bitmask.