util/ip.lua
branch0.11
changeset 11653 aa119de5f6c7
parent 9959 c74c89a96cbf
child 11654 a227bc35771e
equal deleted inserted replaced
11590:35e880501efd 11653:aa119de5f6c7
    98 local ipv6mapped = new_ip("::ffff:0:0");
    98 local ipv6mapped = new_ip("::ffff:0:0");
    99 
    99 
   100 local function v4scope(ip)
   100 local function v4scope(ip)
   101 	if match(ip, loopback4, 8) then
   101 	if match(ip, loopback4, 8) then
   102 		return 0x2;
   102 		return 0x2;
   103 	elseif match(ip, linklocal4) then
   103 	elseif match(ip, linklocal4, 16) then
   104 		return 0x2;
   104 		return 0x2;
   105 	else -- Global unicast
   105 	else -- Global unicast
   106 		return 0xE;
   106 		return 0xE;
   107 	end
   107 	end
   108 end
   108 end