Add missing closure in bird aspath output

This commit is contained in:
Job Snijders
2021-08-20 10:41:32 +00:00
parent bdc455d72e
commit b1074667e8
3 changed files with 13 additions and 5 deletions

View File

@@ -1,3 +1,6 @@
1.4 (2021-08-20)
- Fix BIRD aspath output
1.3 (2021-08-20)
- Change versioning from X.Y.Z to Y.Z
- The repository file hierachy has been reorganized (compat/ include/)

View File

@@ -1 +1 @@
1.3
1.4

View File

@@ -642,7 +642,6 @@ bgpq4_print_bird_aspath(FILE* f, struct bgpq_expander* b)
int nc = 0;
struct asn_entry *asne;
fprintf(f, "%s = [", b->name);
if (RB_EMPTY(&b->asnlist)) {
@@ -651,15 +650,21 @@ bgpq4_print_bird_aspath(FILE* f, struct bgpq_expander* b)
}
RB_FOREACH(asne, asn_tree, &b->asnlist) {
if (!nc)
fprintf(f, "\n %u", asne->asn);
else
if (!nc) {
fprintf(f, "%s\n %u", needscomma ? "," : "",
asne->asn);
needscomma = 1;
} else {
fprintf(f, ", %u", asne->asn);
needscomma = 1;
}
nc++;
if (nc == b->aswidth)
nc = 0;
}
fprintf(f, "];\n");
}
static void