Diff

util/ip.lua @ 8438:499663bd0122

util.ip: Do exact match for longer bit counts than available
author Kim Alvefur <zash@zash.se>
date Fri, 01 Dec 2017 03:31:37 +0100
parent 8437:021129f7b0a3
child 8439:293dbb08427b
line wrap: on
line diff
--- a/util/ip.lua	Fri Dec 01 03:29:25 2017 +0100
+++ b/util/ip.lua	Fri Dec 01 03:31:37 2017 +0100
@@ -228,7 +228,7 @@
 end
 
 function match(ipA, ipB, bits)
-	if not bits then
+	if not bits or bits >= 128 or ipB.proto == "IPv4" and bits >= 32 then
 		return ipA == ipB;
 	elseif bits < 1 then
 		return true;