From: claudio Date: Fri, 5 May 2023 10:48:16 +0000 (+0000) Subject: Pass ASPA objects in reverse since this is what aspa_add_set() expects. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=10b93d6aeb285f4f6b13febe7d471860bfaee26a;p=openbsd Pass ASPA objects in reverse since this is what aspa_add_set() expects. OK tb@ --- diff --git a/usr.sbin/bgpd/rtr.c b/usr.sbin/bgpd/rtr.c index e30d0c4a7b9..e02b09bd822 100644 --- a/usr.sbin/bgpd/rtr.c +++ b/usr.sbin/bgpd/rtr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rtr.c,v 1.14 2023/04/20 15:44:45 claudio Exp $ */ +/* $OpenBSD: rtr.c,v 1.15 2023/05/05 10:48:16 claudio Exp $ */ /* * Copyright (c) 2020 Claudio Jeker @@ -595,7 +595,8 @@ rtr_recalc(void) imsg_compose(ibuf_rde, IMSG_RECONF_ASPA_PREP, 0, 0, -1, &ap, sizeof(ap)); - RB_FOREACH(aspa, aspa_tree, &at) { + /* 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;