diff options
author | Christian Hesse <mail@eworm.de> | 2023-02-09 22:42:02 +0100 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2023-02-10 11:36:12 +0100 |
commit | 62707dc549855e1c4247a9d2df599afc48782902 (patch) | |
tree | b9e7b1266d59ac08fe8d85a7e89490f3f4dd4831 /ipv6-update | |
parent | a34d5d71417d0720e9695b2bfa8657f3734de3b6 (diff) |
ipv6-update: support host addresses in address-listchange-94
Diffstat (limited to 'ipv6-update')
-rw-r--r-- | ipv6-update | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/ipv6-update b/ipv6-update index dd22538..2838feb 100644 --- a/ipv6-update +++ b/ipv6-update @@ -41,9 +41,20 @@ :local Prefix [ /ipv6/address/find where from-pool=$Pool interface=($Comment->"interface") global ]; :if ([ :len $Prefix ] = 1) do={ :set Prefix [ /ipv6/address/get $Prefix address ]; - $LogPrintExit2 info $0 ("Updating IPv6 address list with new IPv6 prefix " . $Prefix . \ - " from interface " . ($Comment->"interface")) false; - /ipv6/firewall/address-list/set address=$Prefix $ListEntry; + + :if ([ :typeof [ :find ($ListEntryVal->"address") "/128" ] ] = "num" ) do={ + :set Prefix ([ :toip6 [ :pick $Prefix 0 [ :find $Prefix "/64" ] ] ] & ffff:ffff:ffff:ffff::); + :local Address ($ListEntryVal->"address"); + :local Address ($Prefix | ([ :toip6 [ :pick $Address 0 [ :find $Address "/128" ] ] ] & ::ffff:ffff:ffff:ffff)); + + $LogPrintExit2 info $0 ("Updating IPv6 address list with new IPv6 host address " . $Address . \ + " from interface " . ($Comment->"interface")) false; + /ipv6/firewall/address-list/set address=$Address $ListEntry; + } else={ + $LogPrintExit2 info $0 ("Updating IPv6 address list with new IPv6 prefix " . $Prefix . \ + " from interface " . ($Comment->"interface")) false; + /ipv6/firewall/address-list/set address=$Prefix $ListEntry; + } } } |