From 79a5880b213d6bfcc5e58d6ee31dfa7d78238c30 Mon Sep 17 00:00:00 2001 From: Tim Wilkinson Date: Thu, 23 Mar 2023 21:50:12 -0700 Subject: [PATCH] Improve ipFromCIDR function to handle /32 cidrs. Unlike any other /X suffix, the /32 is omitted when turned into a string. --- files/usr/lib/lua/aredn/utils.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/usr/lib/lua/aredn/utils.lua b/files/usr/lib/lua/aredn/utils.lua index ba59e977..10889003 100755 --- a/files/usr/lib/lua/aredn/utils.lua +++ b/files/usr/lib/lua/aredn/utils.lua @@ -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