From: claudio Date: Thu, 18 Jan 2024 09:39:36 +0000 (+0000) Subject: Fix IMSG_RECONF_ASPA handling. The rde did not expect what the rtr process X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=d1ecb0c527101f98d2aabc716a8cdf6be4f8bea8;p=openbsd Fix IMSG_RECONF_ASPA handling. The rde did not expect what the rtr process was sending and hit the error path because of that. Since the encoding as two uint32_t in rtr.c is awkward use the same way that the parent is sending the aspa sets. This uses a local copy so that the included expire filed is forced to 0 (the RDE does not use that field). OK tb@ --- diff --git a/usr.sbin/bgpd/rtr.c b/usr.sbin/bgpd/rtr.c index 228869c44eb..4411e398e07 100644 --- a/usr.sbin/bgpd/rtr.c +++ b/usr.sbin/bgpd/rtr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rtr.c,v 1.19 2024/01/04 16:38:18 claudio Exp $ */ +/* $OpenBSD: rtr.c,v 1.20 2024/01/18 09:39:36 claudio Exp $ */ /* * Copyright (c) 2020 Claudio Jeker @@ -530,12 +530,10 @@ rtr_recalc(void) /* walk tree in reverse because aspa_add_set requires that */ RB_FOREACH_REVERSE(aspa, aspa_tree, &at) { - uint32_t as[2]; - as[0] = aspa->as; - as[1] = aspa->num; + struct aspa_set as = { .as = aspa->as, .num = aspa->num }; imsg_compose(ibuf_rde, IMSG_RECONF_ASPA, 0, 0, -1, - &as, sizeof(as)); + &as, offsetof(struct aspa_set, tas)); imsg_compose(ibuf_rde, IMSG_RECONF_ASPA_TAS, 0, 0, -1, aspa->tas, aspa->num * sizeof(*aspa->tas)); imsg_compose(ibuf_rde, IMSG_RECONF_ASPA_DONE, 0, 0, -1,