diff options
author | Kim Alvefur <zash@zash.se> | 2021-07-03 03:27:57 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2021-07-03 03:27:57 +0200 |
commit | 59d820880f0421041b72b73d1fe52aa64adce43d (patch) | |
tree | 864e49573aad4e99f61d5f0243d18979977e2be6 /util | |
parent | 13c5a2359d83818bfeae08b757c53fd34ed05ad8 (diff) | |
download | prosody-59d820880f0421041b72b73d1fe52aa64adce43d.tar.gz prosody-59d820880f0421041b72b73d1fe52aa64adce43d.zip |
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
Diffstat (limited to 'util')
-rw-r--r-- | util/ip.lua | 2 |
1 files changed, 1 insertions, 1 deletions
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; |