On Mon, Oct 16, 2023 at 09:23:12AM +0200, Claudio Jeker wrote:
> This diff fixes a few more things when establishing connections with
> link-local IPv6 addresses. In get_alternate_addr() the interface scope
> of the connection is recovered and then passed to the RDE. The RDE can
> then use this scope id to insert link-local addresses with the correct
> scope.
I like this.
> I built a regress test for this which passes with this diff.
Looks great.
> Now probably more is needed because IPv6 link-local addresses are a gift
> that keep on giving. One thing to implement on top of this is template
> matching for link local -- which allows to auto-configure sessions more
> easily. This will probably follow soon.
A minor cosmetic nit, otherwise ok.
> Index: logmsg.c
This part was already committed.
> Index: rde_rib.c
> ===================================================================
> RCS file: /cvs/src/usr.sbin/bgpd/rde_rib.c,v
> retrieving revision 1.260
> diff -u -p -r1.260 rde_rib.c
> --- rde_rib.c 23 Apr 2023 11:39:10 -0000 1.260
> +++ rde_rib.c 9 Oct 2023 14:05:30 -0000
> @@ -1910,7 +1910,7 @@ nexthop_compare(struct nexthop *na, stru
> case AID_INET6:
> return (memcmp(&a->v6, &b->v6, sizeof(struct in6_addr)));
> default:
> - fatalx("nexthop_cmp: unknown af");
> + fatalx("nexthop_cmp: unknown aid %s", aid2str(a->aid));
if a->aid is bogus this will print 'nexthop_cmp: unknown aid unknown AID'
fatalx("nexthop_cmp: %s is unsupported", aid2str(a->aid));
or reuse the similar log_warnx() from get_alternate_addr()
> }
> return (-1);
> }