ip route add bug in 1.25.0

Ron Yorston rmy at pobox.com
Fri Aug 5 15:29:30 UTC 2016


Ron Yorston wrote:
>Natanael Copa wrote:
>>$ sudo busybox ip route add 192.168.0.0/24 via 10.98.106.9 dev wlan0
>>ip: RTNETLINK answers: Invalid argument
>
>Reverting ce4bc1ed (iproute: support "scope". Closes 8561) seems to
>make the problem go away.

Specifically, this change causes the problem:

-               req.r.rtm_scope = RT_SCOPE_UNIVERSE;
+               if (RT_SCOPE_UNIVERSE != 0)
+                       req.r.rtm_scope = RT_SCOPE_UNIVERSE;

RT_SCOPE_UNIVERSE is zero, so req.r.rtm_scope isn't being initialised.

There are a number of similar constructs in this code, where the value
of an enum is tested against zero.  I've no idea why.

Ron


More information about the busybox mailing list