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:
Tim Wilkinson 2023-03-23 21:50:12 -07:00 committed by Joe AE6XE
parent 6aee2e1305
commit 79a5880b21
1 changed files with 1 additions and 1 deletions

View File

@ -211,7 +211,7 @@ end
-- get IP from CIDR (strip network)
function ipFromCIDR(ip)
return string.match(ip,"(.*)/.-")
return string.match(ip,"(%d+%.%d+%.%d+%.%d+)")
end
-- strips newline from a string