From 65ad337f70d0a1aee4999c99d0062659f7cb6616 Mon Sep 17 00:00:00 2001 From: Thomas Bernard Date: Mon, 29 Apr 2024 01:16:06 +0200 Subject: [PATCH 1/2] miniupnpd: find_ipv6_addr() avoid fc00::/7 if possible fc00::/7 = RFC4193 Unique Local IPv6 Unicast Addresses --- miniupnpd/getifaddr.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/miniupnpd/getifaddr.c b/miniupnpd/getifaddr.c index b6eaee1..06f65db 100644 --- a/miniupnpd/getifaddr.c +++ b/miniupnpd/getifaddr.c @@ -2,7 +2,7 @@ /* vim: tabstop=4 shiftwidth=4 noexpandtab * MiniUPnP project * http://miniupnp.free.fr/ or https://miniupnp.tuxfamily.org/ - * (c) 2006-2023 Thomas Bernard + * (c) 2006-2024 Thomas Bernard * This software is subject to the conditions detailed * in the LICENCE file provided within the distribution */ @@ -264,7 +264,10 @@ find_ipv6_addr(const char * ifname, { addr = (const struct sockaddr_in6 *)ife->ifa_addr; if(!IN6_IS_ADDR_LOOPBACK(&addr->sin6_addr) - && !IN6_IS_ADDR_LINKLOCAL(&addr->sin6_addr)) + && !IN6_IS_ADDR_LINKLOCAL(&addr->sin6_addr) + /* RFC4193 "Unique Local IPv6 Unicast Addresses" only if no + * other address found */ + && (r == 0 || (addr->sin6_addr.s6_addr[0] & 0xfe) != 0xfc)) { inet_ntop(ife->ifa_addr->sa_family, &addr->sin6_addr, From 13184df7c1300afac6d649ca183f1ffa931c7698 Mon Sep 17 00:00:00 2001 From: Thomas Bernard Date: Mon, 29 Apr 2024 01:27:00 +0200 Subject: [PATCH 2/2] ipv6: prefer globally routable addresses --- miniupnpd/Changelog.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/miniupnpd/Changelog.txt b/miniupnpd/Changelog.txt index 81c4724..7874cb5 100644 --- a/miniupnpd/Changelog.txt +++ b/miniupnpd/Changelog.txt @@ -1,5 +1,8 @@ $Id: Changelog.txt,v 1.515 2024/03/19 23:40:30 nanard Exp $ +2024/04/29: + ipv6: prefer globally routable addresses + VERSION 2.3.6 : released on 2024/03/20 2024/03/05: