Mercurial > prosody-hg
comparison util/ip.lua @ 11650:a227bc35771e
Merge 0.11->trunk
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Sat, 03 Jul 2021 17:28:07 +0200 |
| parents | 079b31c8dbf2 aa119de5f6c7 |
| children | a0ff5c438e9d |
comparison
equal
deleted
inserted
replaced
| 11648:96d3cbeb9275 | 11650:a227bc35771e |
|---|---|
| 104 local ipv6mapped = new_ip("::ffff:0:0"); | 104 local ipv6mapped = new_ip("::ffff:0:0"); |
| 105 | 105 |
| 106 local function v4scope(ip) | 106 local function v4scope(ip) |
| 107 if match(ip, loopback4, 8) then | 107 if match(ip, loopback4, 8) then |
| 108 return 0x2; | 108 return 0x2; |
| 109 elseif match(ip, linklocal4) then | 109 elseif match(ip, linklocal4, 16) then |
| 110 return 0x2; | 110 return 0x2; |
| 111 else -- Global unicast | 111 else -- Global unicast |
| 112 return 0xE; | 112 return 0xE; |
| 113 end | 113 end |
| 114 end | 114 end |
