Skip to content

aspa: Fix ASPA validation for AS paths with AS path prepending#320

Open
Brias wants to merge 2 commits intomasterfrom
bugfix/aspa-validation-with-as-path-prepending
Open

aspa: Fix ASPA validation for AS paths with AS path prepending#320
Brias wants to merge 2 commits intomasterfrom
bugfix/aspa-validation-with-as-path-prepending

Conversation

@Brias
Copy link
Copy Markdown
Contributor

@Brias Brias commented Jan 7, 2026

Contribution description

Previously, the ASPA validation was not performed on the compressed AS path which yielded incorrect results for AS paths where at least one AS number appeared multiple times in a row and that AS did not add itself as a provider in its ASPA record. This was against the ASPA RFC, which mandates validation on the compressed AS path.

Testing procedure

The existing ASPA test have been fixed and extended so that the ASPA validation of AS paths with AS path prepending is tested for the upstream and downstream direction.

Issues/PRs references

n/a

Edit: I saw that a function existed for removing consecutive duplicate ASNs, so this is not actually a bug. However, I see two issues with the previous approach:

  1. The calling code needs to do two function calls for the ASPA validation which might lead to bugs. Compressing the AS path inside the ASPA validation functions simplify the library interface.
  2. The function for compressing the AS path modified the AS path which means the calling code needs to first copy the whole path if it wants to use it further. The approach proposed in this PR doesn't change the given AS path but simply ignores consecutive duplicates, which should be faster and also make the library easier to use.

Previously, the ASPA validation was not performed on the compressed
AS path which yielded incorrect results for AS paths where at least
one AS number appeared multiple times in a row and that AS did not
add itself as a provider in its ASPA record. This was against the
ASPA RFC, which mandates validation on the compressed AS path.
@Brias Brias requested a review from tanneberger January 7, 2026 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant