[Bug 9141] ip: RTNETLINK answers: Invalid argument

bugzilla at busybox.net bugzilla at busybox.net
Sat Aug 6 18:21:35 UTC 2016


https://bugs.busybox.net/show_bug.cgi?id=9141

--- Comment #4 from Neil MacLeod <busybox at nmacleod.com> ---
Alternatively the problem might here:

https://github.com/mirror/busybox/commit/ce4bc1ed048233e89ee4cb95830bf6f01d523d1e#diff-17b20e94edc19bc0556a07b3f860041eR484

Using the example "route add" commands, in the "if (!scope_ok) {" block
req.r.rtm_type is RTN_UNICAST while req.r.rtm_scope is RT_SCOPE_NOWHERE, which
means the code falls through to
https://github.com/mirror/busybox/commit/ce4bc1ed048233e89ee4cb95830bf6f01d523d1e#diff-17b20e94edc19bc0556a07b3f860041eR497
which fails as "(!(ok & gw_ok))" is not true, so req.r.rtm_scope remains set to
RT_SCOPE_NOWHERE.

The following patch works for me, I've but no idea if this is what is needed
for others.

diff --git a/networking/libiproute/iproute.c b/networking/libiproute/iproute.c
index e674e9a..42f8bda 100644
--- a/networking/libiproute/iproute.c
+++ b/networking/libiproute/iproute.c
@@ -498,6 +498,8 @@ IF_FEATURE_IP_RULE(ARG_table,)
                                req.r.rtm_scope = RT_SCOPE_NOWHERE;
                        else if (!(ok & gw_ok))
                                req.r.rtm_scope = RT_SCOPE_LINK;
+                       else
+                               req.r.rtm_scope = RT_SCOPE_UNIVERSE;
                }
        }

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the busybox-cvs mailing list