From 59d820880f0421041b72b73d1fe52aa64adce43d Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sat, 3 Jul 2021 03:27:57 +0200 Subject: util.ip: Fix netmask for link-local address range This may have mistakenly caused link-local addresses to be considered global. May have caused mod_s2s and prosodyctl check dns to behave incorrectly on networks using link-local IPv4 addresses. By my guesstimate, these are extremely rare. Probably minimal impact beyond a bit longer to establish s2s and some possible confusion from prosodyctl check dns results. Ref RFC 3927 --- util/ip.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'util') diff --git a/util/ip.lua b/util/ip.lua index d1808225..05c4ca14 100644 --- a/util/ip.lua +++ b/util/ip.lua @@ -100,7 +100,7 @@ local ipv6mapped = new_ip("::ffff:0:0"); local function v4scope(ip) if match(ip, loopback4, 8) then return 0x2; - elseif match(ip, linklocal4) then + elseif match(ip, linklocal4, 16) then return 0x2; else -- Global unicast return 0xE; -- cgit v1.2.3