The missing parens lead to a wrong expression precedence, causing a runtime
error when attempting to compare nil with a number.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
local ip, mask = val:match("^([^/]+)/([^/]+)$")
local bits = tonumber(mask)
- if bits and bits < 0 or bits > 32 then
+ if bits and (bits < 0 or bits > 32) then
return false
end
local ip, mask = val:match("^([^/]+)/([^/]+)$")
local bits = tonumber(mask)
- if bits and bits < 0 or bits > 128 then
+ if bits and (bits < 0 or bits > 128) then
return false
end