Changeset

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
parents 8440:4e6710b4f873
children 8442:3a390fa561bf
files util/ip.lua
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
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 = {