util.ip: Do equality checking by comparing packed representation to avoid any variations

This commit is contained in:
Kim Alvefur 2017-12-01 05:13:28 +01:00
parent f31e73eb48
commit e2ef028b09

View file

@ -19,7 +19,7 @@ local ip_mt = {
return ret;
end,
__tostring = function (ip) return ip.addr; end,
__eq = function (ipA, ipB) return ipA.addr == ipB.addr; end
__eq = function (ipA, ipB) return ipA.packed == ipB.packed; end
};
local hex2bits = {