mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2025-12-06 09:59:28 +00:00
fw-addr-lists: use $NetMask6
This commit is contained in:
parent
d7a6eb1d00
commit
ea05b69f7c
1 changed files with 4 additions and 4 deletions
|
|
@ -26,8 +26,8 @@
|
||||||
:global LogPrint;
|
:global LogPrint;
|
||||||
:global LogPrintOnce;
|
:global LogPrintOnce;
|
||||||
:global LogPrintVerbose;
|
:global LogPrintVerbose;
|
||||||
:global MIN;
|
|
||||||
:global NetMask4;
|
:global NetMask4;
|
||||||
|
:global NetMask6;
|
||||||
:global ScriptLock;
|
:global ScriptLock;
|
||||||
:global WaitFullyConnected;
|
:global WaitFullyConnected;
|
||||||
|
|
||||||
|
|
@ -130,13 +130,13 @@
|
||||||
}
|
}
|
||||||
:if ($Address ~ "^[0-9a-zA-Z]*:[0-9a-zA-Z:\\.]+(/[0-9]{1,3})?\$") do={
|
:if ($Address ~ "^[0-9a-zA-Z]*:[0-9a-zA-Z:\\.]+(/[0-9]{1,3})?\$") do={
|
||||||
:local Net $Address;
|
:local Net $Address;
|
||||||
:local Cidr 64;
|
:local CIDR 128;
|
||||||
:local Slash [ :find $Address "/" ];
|
:local Slash [ :find $Address "/" ];
|
||||||
:if ([ :typeof $Slash ] = "num") do={
|
:if ([ :typeof $Slash ] = "num") do={
|
||||||
:set Net [ :toip6 [ :pick $Address 0 $Slash ] ]
|
:set Net [ :toip6 [ :pick $Address 0 $Slash ] ]
|
||||||
:set Cidr [ $MIN [ :pick $Address ($Slash + 1) [ :len $Address ] ] 64 ];
|
:set CIDR [ :pick $Address ($Slash + 1) [ :len $Address ] ];
|
||||||
}
|
}
|
||||||
:set Address (([ :toip6 $Net ] & ffff:ffff:ffff:ffff::) . "/" . $Cidr);
|
:set Address (([ :toip6 $Net ] & [ $NetMask6 $CIDR ]) . "/" . $CIDR);
|
||||||
:set Branch [ $GetBranch $Address ];
|
:set Branch [ $GetBranch $Address ];
|
||||||
:set ($IPv6Addresses->$Branch->$Address) $TimeOut;
|
:set ($IPv6Addresses->$Branch->$Address) $TimeOut;
|
||||||
:error true;
|
:error true;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue