aboutsummaryrefslogtreecommitdiffstats
path: root/fw-addr-lists.rsc
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2024-04-05 00:20:33 +0200
committerGravatar Christian Hesse <mail@eworm.de>2024-04-07 22:21:10 +0200
commit4b6d0c02f134f4c6535d4df44016dc9ae2ae5db2 (patch)
tree955d426b644da5d2dada1eb2a016cf0ea48288c9 /fw-addr-lists.rsc
parentc3809f240d292e80c936e104e8aa9414b3dd3367 (diff)
fw-addr-lists: try with less regexp matches
Diffstat (limited to 'fw-addr-lists.rsc')
-rw-r--r--fw-addr-lists.rsc23
1 files changed, 15 insertions, 8 deletions
diff --git a/fw-addr-lists.rsc b/fw-addr-lists.rsc
index 66f8581..7e7ee38 100644
--- a/fw-addr-lists.rsc
+++ b/fw-addr-lists.rsc
@@ -82,14 +82,21 @@
: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})?\$" || \
- $Address ~ "^[\\.a-zA-Z0-9-]+\\.[a-zA-Z]{2,}\$") do={
- :set ($IPv4Addresses->$Address) $TimeOut;
- }
- :if ($Address ~ "^[0-9a-zA-Z]*:[0-9a-zA-Z:\\.]+(/[0-9]{1,3})?\$" || \
- $Address ~ "^[\\.a-zA-Z0-9-]+\\.[a-zA-Z]{2,}\$") do={
- :set ($IPv6Addresses->$Address) $TimeOut;
- }
+ :do {
+ :if ($Address ~ "^[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}(/[0-9]{1,2})?\$") do={
+ :set ($IPv4Addresses->$Address) $TimeOut;
+ :error true;
+ }
+ :if ($Address ~ "^[0-9a-zA-Z]*:[0-9a-zA-Z:\\.]+(/[0-9]{1,3})?\$") do={
+ :set ($IPv6Addresses->$Address) $TimeOut;
+ :error true;
+ }
+ :if ($Address ~ "^[\\.a-zA-Z0-9-]+\\.[a-zA-Z]{2,}\$") do={
+ :set ($IPv4Addresses->$Address) $TimeOut;
+ :set ($IPv6Addresses->$Address) $TimeOut;
+ :error true;
+ }
+ } on-error={ }
:set Data [ :pick $Data ([ :len $Line ] + 1) [ :len $Data ] ];
}
}