Skip to content

Conversation

@Paul-weqe
Copy link
Member

@Paul-weqe Paul-weqe commented May 11, 2025

bgp: add tests and fixes for attribute decoders

add tests for:

  • Attr decode
  • AsPathSegment decode
  • MpReachNlri decode

Fixes the issues that had been raised due to the tests above failing.

Issues in these tests were yet again raised due to fuzzing.

@Paul-weqe
Copy link
Member Author

Paul-weqe commented May 11, 2025

@rwestphal whenever the size check fails, I always returned an Err of AttrErr::Discard.

I'd like a check from you if there is anywhere that `Withdraw would have been preferred, before I change this to ready for review.

This is also branched from Paul-weqe:bgp-fuzz-fixes so it may make more sense to check out #64 before checking this out.

Issues raised by fuzzing mainly involved size checks of packets that
are being decoded.

This commit fixes those issues in the holo-bgp/src/packet/message.rs
file.

Signed-off-by: Paul Wekesa <paul1tw1@gmail.com>
@Paul-weqe Paul-weqe force-pushed the bgp-attr-fuzz-fixes branch from 52b1b39 to ed24f96 Compare May 11, 2025 09:50
- add tests for:
  * Attr decode
  * AsPathSegment decode
  * MpReachNlri decode

- fix decode asn

Signed-off-by: Paul Wekesa <paul1tw1@gmail.com>
@Paul-weqe Paul-weqe force-pushed the bgp-attr-fuzz-fixes branch from ed24f96 to 27b56bf Compare May 11, 2025 10:27
@Paul-weqe Paul-weqe mentioned this pull request May 12, 2025
@Paul-weqe Paul-weqe marked this pull request as ready for review May 13, 2025 04:28
@Paul-weqe Paul-weqe closed this May 25, 2025
@Paul-weqe Paul-weqe deleted the bgp-attr-fuzz-fixes branch May 28, 2025 08:31
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