lua-resty-ipmatcher icon indicating copy to clipboard operation
lua-resty-ipmatcher copied to clipboard

Return nil, err on invalid mask

Open bungle opened this issue 6 years ago • 1 comments

This:

ipmatcher.new({"0.0.0.0/asdfsdf", "0.0.0.0/-1", "0.0.0.0/343546w3462343" })

return a table, while this returns nil, "invalid ip address: blaa0.0.0.0":

ipmatcher.new({"blaa0.0.0.0/asdfsdf", "0.0.0.0/-1", "0.0.0.0/343546w3462343" })

Perhaps the first should also return nil, "invalid subnet mask: asdfsdf".

What do you think? Thanks for the nice lib!

bungle avatar Mar 10 '20 21:03 bungle

@bungle you are right, agree with you

PR welcome

membphis avatar Mar 12 '20 12:03 membphis