From b1074667e8852a728dd554f339f18d85eaf558bf Mon Sep 17 00:00:00 2001 From: Job Snijders Date: Fri, 20 Aug 2021 10:41:32 +0000 Subject: [PATCH] Add missing closure in bird aspath output --- CHANGES | 3 +++ VERSION | 2 +- printer.c | 13 +++++++++---- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/CHANGES b/CHANGES index f24d0e3..eb6507b 100644 --- a/CHANGES +++ b/CHANGES @@ -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/) diff --git a/VERSION b/VERSION index 7e32cd5..c068b24 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.3 +1.4 diff --git a/printer.c b/printer.c index 4c9983b..b6cd022 100644 --- a/printer.c +++ b/printer.c @@ -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