Skip to content

Commit

Permalink
filter out ASN 0 in juniper as-lists (#117)
Browse files Browse the repository at this point in the history
Fixes error "RPD Policy: Invalid AS 0"
  • Loading branch information
yu-re-ka authored Oct 16, 2024
1 parent ad20b71 commit c51fdde
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions printer.c
Original file line number Diff line number Diff line change
Expand Up @@ -300,12 +300,15 @@ bgpq4_print_juniper_aslist(FILE *f, struct bgpq_expander *b)

RB_FOREACH(asne, asn_tree, &b->asnlist) {
if (!nc) {
fprintf(f, " as-list a%u members [ %u",
lineNo, asne->asn);
} else {
fprintf(f," %u", asne->asn);
fprintf(f, " as-list a%u members [",
lineNo);
}

// Filter out AS 0
// "error: RPD Policy: Invalid AS 0"
if (asne->asn != 0)
fprintf(f," %u", asne->asn);

nc++;

if (nc == b->aswidth) {
Expand Down

0 comments on commit c51fdde

Please sign in to comment.