diff options
author | Christian Hesse <mail@eworm.de> | 2023-06-12 09:14:36 +0200 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2023-06-13 20:26:55 +0200 |
commit | 94b07600baff987161e4f661ff14bddeef9a6174 (patch) | |
tree | 8660a5263935fb87d016a9870a976448d5e4b6e1 | |
parent | 458fe7c08857afa841feb018ac29780b3e4496a9 (diff) |
fw-addr-lists: support domain names in lists
-rw-r--r-- | fw-addr-lists.rsc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fw-addr-lists.rsc b/fw-addr-lists.rsc index 5117c3e..b33638e 100644 --- a/fw-addr-lists.rsc +++ b/fw-addr-lists.rsc @@ -19,7 +19,7 @@ :global WaitFullyConnected; :local FindDelim do={ - :local ValidChars "0123456789./"; + :local ValidChars "0123456789./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-"; :for I from=0 to=[ :len $1 ] do={ :if ([ :typeof [ :find $ValidChars [ :pick ($1 . " ") $I ] ] ] != "num") do={ :return $I; @@ -28,7 +28,6 @@ } $ScriptLock $0; - $WaitFullyConnected; :local ListComment ("managed by " . $0); @@ -61,7 +60,8 @@ $WaitFullyConnected; :while ([ :len $Data ] != 0) do={ :local Line [ :pick $Data 0 [ :find $Data "\n" ] ]; :local Address ([ :pick $Line 0 [ $FindDelim $Line ] ] . ($List->"cidr")); - :if ($Address ~ "^[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}(/[0-9]{1,2})?\$") do={ + :if ($Address ~ "^[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}(/[0-9]{1,2})?\$" || \ + $Address ~ "^[\\.a-zA-Z0-9-]+\\.[a-zA-Z]{2,}\$") do={ :set ($Addresses->$Address) 1; } :set Data [ :pick $Data ([ :len $Line ] + 1) [ :len $Data ] ]; |