From: Theo Buehler Subject: Re: bgpd: cleanup AID / AFI handling To: Claudio Jeker Cc: tech@openbsd.org Date: Wed, 20 Mar 2024 04:51:09 +1000 On Tue, Mar 19, 2024 at 04:45:02PM +0100, Claudio Jeker wrote: > Looping over all valid AID should use: > for (i = AID_MIN; i < AID_MAX; i++) > > Now this diff tries to enforce this everywhere and in the few cases where > this is not the case I use: > for (i = AID_UNSPEC; i < AID_MAX; i++) > > For aid2afi() make sure that AID_UNSPEC returns an error and not some bad > value. > > Additionally check in some cases not only for AID_MAX but also for > AID_MIN. E.g. when sending router-refresh messages. > > Now the add-path capability uses AID_UNSPEC to indicate if it is in use > or not. It also used this for our announce settings but that is not needed > so only do this trick in the negotiated values. Much better. Can't spot anything wrong with it. ok tb