Index | Thread | Search

From:
Claudio Jeker <cjeker@diehard.n-r-g.com>
Subject:
bgpd: fix printconf of origin-set
To:
tech@openbsd.org
Date:
Tue, 4 Nov 2025 11:50:34 +0100

Download raw body.

Thread
The origin-set printconf code should just call log_roa() since an
origin-set is the same as the roa-set only without expire (so it defaults
to 0).

Fix for CID 492355
-- 
:wq Claudio

Index: printconf.c
===================================================================
RCS file: /cvs/src/usr.sbin/bgpd/printconf.c,v
diff -u -p -r1.182 printconf.c
--- printconf.c	10 Mar 2025 14:11:38 -0000	1.182
+++ printconf.c	3 Nov 2025 21:46:35 -0000
@@ -670,18 +670,11 @@ print_originsets(struct prefixset_head *
 {
 	struct prefixset	*ps;
 	struct roa		*roa;
-	struct bgpd_addr	 addr;
 
 	SIMPLEQ_FOREACH(ps, psh, entry) {
 		printf("origin-set \"%s\" {", ps->name);
 		RB_FOREACH(roa, roa_tree, &ps->roaitems) {
-			printf("\n\t");
-			addr.aid = roa->aid;
-			addr.v6 = roa->prefix.inet6;
-			printf("%s/%u", log_addr(&addr), roa->prefixlen);
-			if (roa->prefixlen != roa->maxlen)
-				printf(" maxlen %u", roa->maxlen);
-			printf(" source-as %u", roa->asnum);
+			printf("\n\t%s", log_roa(roa));
 		}
 		printf("\n}\n\n");
 	}