From: Theo Buehler Subject: Re: bgpd: no need to check ASPA SPAS size for imsg size To: tech@openbsd.org Date: Mon, 2 Dec 2024 16:11:25 +0100 On Mon, Dec 02, 2024 at 04:07:35PM +0100, Claudio Jeker wrote: > Remove the IMSG overflow check for ASAP objects. This is no longer needed > since the new maximum imsg size is way larger then the maximum number of > ASPA SPAS elements (10k). ok tb > -- > :wq Claudio > > Index: bgpd.c > =================================================================== > RCS file: /cvs/src/usr.sbin/bgpd/bgpd.c,v > diff -u -p -r1.278 bgpd.c > --- bgpd.c 2 Dec 2024 15:03:17 -0000 1.278 > +++ bgpd.c 2 Dec 2024 15:04:55 -0000 > @@ -733,14 +733,6 @@ send_config(struct bgpd_config *conf) > } > free_roatree(&conf->roa); > RB_FOREACH(aspa, aspa_tree, &conf->aspa) { > - /* XXX prevent oversized IMSG for now */ > - if (aspa->num * sizeof(*aspa->tas) > > - MAX_IMSGSIZE - IMSG_HEADER_SIZE) { > - log_warnx("oversized ASPA set for customer-as %s, %s", > - log_as(aspa->as), "dropped"); > - continue; > - } > - > if (imsg_compose(ibuf_rtr, IMSG_RECONF_ASPA, 0, 0, > -1, aspa, offsetof(struct aspa_set, tas)) == -1) > return (-1); > Index: rtr.c > =================================================================== > RCS file: /cvs/src/usr.sbin/bgpd/rtr.c,v > diff -u -p -r1.28 rtr.c > --- rtr.c 2 Dec 2024 15:03:18 -0000 1.28 > +++ rtr.c 2 Dec 2024 15:04:55 -0000 > @@ -539,14 +539,6 @@ rtr_recalc(void) > RB_FOREACH_REVERSE(aspa, aspa_tree, &at) { > struct aspa_set as = { .as = aspa->as, .num = aspa->num }; > > - /* XXX prevent oversized IMSG for now */ > - if (aspa->num * sizeof(*aspa->tas) > > - MAX_IMSGSIZE - IMSG_HEADER_SIZE) { > - log_warnx("oversized ASPA set for customer-as %s, %s", > - log_as(aspa->as), "dropped"); > - continue; > - } > - > imsg_compose(ibuf_rde, IMSG_RECONF_ASPA, 0, 0, -1, > &as, offsetof(struct aspa_set, tas)); > imsg_compose(ibuf_rde, IMSG_RECONF_ASPA_TAS, 0, 0, -1, >