mod_net_proxy/mod_net_proxy.lua
changeset 2939 7319fd5dbc89
parent 2935 e79b9a55aa2e
child 2965 33227efa2cdc
equal deleted inserted replaced
2938:5c60df8b1a07 2939:7319fd5dbc89
    21 	elseif input:len() == 16 then
    21 	elseif input:len() == 16 then
    22 		local octets = { nil, nil, nil, nil, nil, nil, nil, nil };
    22 		local octets = { nil, nil, nil, nil, nil, nil, nil, nil };
    23 
    23 
    24 		-- Convert received bytes into IPv6 address and skip leading zeroes for each group
    24 		-- Convert received bytes into IPv6 address and skip leading zeroes for each group
    25 		for index = 1, 8 do
    25 		for index = 1, 8 do
    26 			high, low = input:byte(index * 2 - 1, index * 2);
    26 			local high, low = input:byte(index * 2 - 1, index * 2);
    27 			octets[index] = string.format("%x", high * 256 + low);
    27 			octets[index] = string.format("%x", high * 256 + low);
    28 		end
    28 		end
    29 		local address = table.concat(octets, ":", 1, 8);
    29 		local address = table.concat(octets, ":", 1, 8);
    30 
    30 
    31 		-- Search for the longest sequence of zeroes
    31 		-- Search for the longest sequence of zeroes