From: Theo Buehler Subject: Re: bgpd: fix printconf of origin-set To: tech@openbsd.org Date: Tue, 4 Nov 2025 12:02:55 +0100 On Tue, Nov 04, 2025 at 11:50:34AM +0100, Claudio Jeker wrote: > 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 ok tb (don't know if the body of the SIMPLEQ_FOREACH() wants deduplicating with print_roa()) > -- > :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"); > } >