From 62707dc549855e1c4247a9d2df599afc48782902 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Thu, 9 Feb 2023 22:42:02 +0100 Subject: ipv6-update: support host addresses in address-list --- ipv6-update | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'ipv6-update') 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; + } } } -- cgit v1.2.3-70-g09d2