Diff

util/ip.lua @ 8441:e6e69be59233

util.ip: Do equality checking by comparing packed representation to avoid any variations
author Kim Alvefur <zash@zash.se>
date Fri, 01 Dec 2017 05:13:28 +0100
parent 8439:293dbb08427b
child 8468:5bfe58539b6c
line wrap: on
line diff
--- a/util/ip.lua	Fri Dec 01 04:54:23 2017 +0100
+++ b/util/ip.lua	Fri Dec 01 05:13:28 2017 +0100
@@ -19,7 +19,7 @@
 		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 = {