From: claudio Date: Mon, 10 Jun 2024 12:51:25 +0000 (+0000) Subject: In get_alternate_addr() consider sessions to IPv6 link-local addresses X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=3dbf4d6d62db0c99ab13f3e5685b7d89c64270a8;p=openbsd In get_alternate_addr() consider sessions to IPv6 link-local addresses as connected (they are so by definition). Issue reported by Jason Tubnor ( Jason.Tubnor (at) lchs.com.au ) OK tb@ --- diff --git a/usr.sbin/bgpd/session.c b/usr.sbin/bgpd/session.c index ad60a17fe60..dd24eb29a3e 100644 --- a/usr.sbin/bgpd/session.c +++ b/usr.sbin/bgpd/session.c @@ -1,4 +1,4 @@ -/* $OpenBSD: session.c,v 1.479 2024/05/29 10:38:24 claudio Exp $ */ +/* $OpenBSD: session.c,v 1.480 2024/06/10 12:51:25 claudio Exp $ */ /* * Copyright (c) 2003, 2004, 2005 Henning Brauer @@ -1254,7 +1254,11 @@ get_alternate_addr(struct bgpd_addr *local, struct bgpd_addr *remote, match->ifa_addr->sa_family != AF_INET6) continue; if (sa_equal(local, match->ifa_addr)) { - if (match->ifa_flags & IFF_POINTOPOINT && + if (remote->aid == AID_INET6 && + IN6_IS_ADDR_LINKLOCAL(&remote->v6)) { + /* IPv6 LLA are by definition connected */ + connected = 1; + } else if (match->ifa_flags & IFF_POINTOPOINT && match->ifa_dstaddr != NULL) { if (sa_equal(remote, match->ifa_dstaddr)) connected = 1;