Skip to content

DP-7586 Fail parsing on unsupported RIB_GENERIC SAFI#3

Merged
dfkyle merged 1 commit intoparse-mrt-rdfrom
DP-7586-unsupported-safi
Mar 30, 2026
Merged

DP-7586 Fail parsing on unsupported RIB_GENERIC SAFI#3
dfkyle merged 1 commit intoparse-mrt-rdfrom
DP-7586-unsupported-safi

Conversation

@dfkyle
Copy link
Copy Markdown

@dfkyle dfkyle commented Mar 30, 2026

The Problem

The RIB_GENERIC parser tries to parse NLRI prefixes for unsupported SAFI types (currently we are only interested in MplsVpn).

The Solution

Skip all unsupported SAFIs. This is what the RFC recommends as well.

An implementation that does not recognize particular AFI and SAFI
values SHOULD discard the remainder of the MRT record

Note that RIB_GENERIC is a catch-all for uncommon case entries. Common use cases have dedicated subtypes (c.f. https://datatracker.ietf.org/doc/html/rfc6396#section-4.3.2).

How to Test

Skip tests that make network requests

support@docker-host-unknown:~/bgpkit-parser$ cargo clippy && \
OPENSSL_DIR=/usr OPENSSL_LIB_DIR=/usr/lib/x86_64-linux-gnu cargo test --quiet -- \
  --skip test_new_with_reader \
  --skip test_new_cached_with_reader \
  --skip test_filters_on_mrt_file \
  --skip test_filter_iter \
  --skip test_filter_iter_with_negation \
  --skip test_filter_iter_multi_peers \
  --skip test_negated_filters_on_mrt_file \
  --skip test_parser_as_paths_conversion \
  --skip test_record_iter_raw_record_iter_types \
  --skip test_encode_small \
  --skip test_encode_ipv6 \
  --skip test_encode_large \
  --skip test_encode_table_dump_v1
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.10s

running 460 tests
....................................................................................... 87/460
....................................................................................... 174/460
....................................................................................... 261/460
....................................................................................... 348/460
....................................................................................... 435/460
.........................
test result: ok. 460 passed; 0 failed; 0 ignored; 0 measured; 10 filtered out; finished in 1.42s


running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 2 filtered out; finished in 0.00s


running 5 tests
.....
test result: ok. 5 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s


running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 4 filtered out; finished in 0.00s


running 46 tests
iii...............iii.........................
test result: ok. 40 passed; 0 failed; 6 ignored; 0 measured; 0 filtered out; finished in 1.00s

@dfkyle dfkyle changed the title fail parsing of unsupported safi DP-7586 Fail parsing of unsupported RIB_GENERIC SAFI Mar 30, 2026
@dfkyle dfkyle marked this pull request as ready for review March 30, 2026 18:20
@dfkyle dfkyle changed the title DP-7586 Fail parsing of unsupported RIB_GENERIC SAFI DP-7586 Fail parsing on unsupported RIB_GENERIC SAFI Mar 30, 2026
@dfkyle dfkyle merged commit dd2ec75 into parse-mrt-rd Mar 30, 2026
@dfkyle dfkyle deleted the DP-7586-unsupported-safi branch March 30, 2026 21:29
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.

2 participants