upstream: treat unscoped IPv6 link-local addresses as having

wildcard scope when used in `Match address` or similar. Seems like the least
surprising thing to do

Anthropic ANT-2026-4VBYIC2Q

OpenBSD-Commit-ID: b1437244abdad94abdd9e5adf59211f1866576c2
This commit is contained in:
djm@openbsd.org authored and Damien Miller committed 2026-10-30 20:16:30 +11:00
1 parent 99b84cbe66
commit 09e6d6be23
1 file changed
+7 -1
+7 -1
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: addr.c,v 1.10 2026/03/03 09:57:25 dtucker Exp $ */
/* $OpenBSD: addr.c,v 1.11 2026/10/30 06:24:55 djm Exp $ */
/*
* Copyright (c) 2004-2008 Damien Miller <djm@mindrot.org>
@@ -506,5 +506,11 @@ addr_netmatch(const struct xaddr *host, const struct xaddr *net, u_int masklen)
return -1;
if (addr_and(&tmp_result, host, &tmp_mask) == -1)
return -1;
/*
* A network specified without an interface scope (e.g. fe80::/10)
* matches hosts in any scope; otherwise the scope must match too.
*/
if (net->af == AF_INET6 && net->scope_id == 0)
tmp_result.scope_id = 0;
return addr_cmp(&tmp_result, net);
}