V4.0 beta 4 - script bug - ip route find dst-address - DDNS

I found this bug because changeip DDNS update script doesn’t work after V4.0 beta 4 upgrade.

/ip route find dst-address=0.0.0.0/0

doesn’t work.

I made some terminal test to demonstrate it:

foreach r in=[/ip route find active=yes ] do={:put [/ip route get $r dst-address]}
0.0.0.0/0
10.1.1.0/24
10.1.43.0/24
10.1.44.0/24
10.90.0.0/19
10.100.1.0/24

/ip route> :put [find static=yes]]
*30000001;*1;*B;*2;*3;*4;*5;*6;*7;*A;*8;*9
/ip route> :put [find static=yes dynamic=yes active=yes]
*30000001
/ip route> :put [get [find static=yes dynamic=yes active=yes]
dst-address]
0.0.0.0/0
/ip route> :put [get [find dst-address=0.0.0.0/0] dst-address]
no such item

P.S. I loaded V4.0 beta only to use my R2n Radio.
There is anyway to use R2n card with 3.x without MIMO 802.11n support (only 802.11b/g)?

Additional search word: dynamic dns

Try

/ip route find dst-address="0.0.0.0/0"

with quotation marks, maybe that’ll work? I don’t have a V4 device around to test it.

I will be loading up 4.x this week and making a script that works. . . on my top priority list going forward. It seems like global variables dont work in 4.x, or something else is wrong. Will post more details in a bit.

I already tryed, doesn’t work.

this will be fixed in next release of 4.0beta

does Mikrotik have any beta release plan?
I have to take decision about waiting a new beta release or downgrade to V3.30 (license key downgrade terror .. :smiley: )

V4.0 rc1 fixed it.

uhmm… for sure DDNS script doesn’t work.

I Found problem with this sentence:
:if ([:typeof [/ip route get $int routing-mark ]] != str ) do={…

But… It’easy to workaround it. the real problem is that:
:global ddnsinterface [/ip route get $int interface]

“Interface” field doesn’t exist more … :frowning:

Off course there is some strange behaviour regarding global variables. Some global variables behaves like local.
If you set some global variable in script1, :env print will show some variable set, and some variable = [:nothing]

strange variable behavior is dued by :foreach sentence

http://forum.mikrotik.com/t/v4-0-rc1-script-bug-variable-scope-lifetime-foreach/31720/1