Changed scripting coding between V6 and v7

Here we can put the differences in scripting between v6 an v7 so if there thing not working anymore you can take a peek here if it already know. It saves a lot of keyboard from breakage by hitting with them on the monitor…flatscreen.

Please no discussions and just state the changes like underneath.

v6

/ip firewall nat> :put "$[:len [find routing-mark="Leak-IKEV" ]]"         
2
/ip firewall nat> :put "$[:len [find routing-mark "Leak-IKEV" ]]" 
0

v7

/ip firewall nat> :put "$[:len [find routing-mark="Leak-IKEV" ]]"         
0
/ip firewall nat> :put "$[:len [find routing-mark "Leak-IKEV" ]]" 
2

Exactly reversed behavior here.

In answer to mrz: this will work on v6 and v7. I use this to check if there are only two of them and if more, remove all matching en add these two lines.

/ip firewall nat> :put "$[:len [find routing-mark~"Leak-IKEV" ]]"

[find routing-mark “Leak-IKEV” ] is incorrect syntax to what you want to achieve. With this you are matching all rule that has routing-mark set to any value.

routing-mark=“Leak-IKEV” is correct way, but unfortunately at the moment string matching is broken, it will be fixed in one of the next RC version.

What changes between 6.47.10 and 7.1rc4:
On 6.x we can define “routing-mark” at any point where it can be set, as well as NAT.
On 7.1rc4 first of all the routing table must be defined before it can be used on other sections, such as NAT.

Synthesis

# 6.47.10
:put [:len [/ip firewall nat find where routing-mark="Leak-IKEV"]]

# 7.1rc4
:put [:len [/ip firewall nat find where routing-mark=[/routing table find where name="Leak-IKEV"]]]