mirror of https://github.com/aredn/aredn.git
Improve ipFromCIDR function to handle /32 cidrs.
Unlike any other /X suffix, the /32 is omitted when turned into a string.
This commit is contained in:
parent
6aee2e1305
commit
79a5880b21
|
@ -211,7 +211,7 @@ end
|
||||||
|
|
||||||
-- get IP from CIDR (strip network)
|
-- get IP from CIDR (strip network)
|
||||||
function ipFromCIDR(ip)
|
function ipFromCIDR(ip)
|
||||||
return string.match(ip,"(.*)/.-")
|
return string.match(ip,"(%d+%.%d+%.%d+%.%d+)")
|
||||||
end
|
end
|
||||||
|
|
||||||
-- strips newline from a string
|
-- strips newline from a string
|
||||||
|
|
Loading…
Reference in New Issue