ip route: get: only set RTM_F_LOOKUP_TABLE flag for IPv4

Kernel ignores the RTM_F_LOOKUP_TABLE flag for all families
but IPv4.  Don't set it, otherwise it may fall foul of
strict checking policies.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
This commit is contained in:
Jakub Kicinski 2019-01-12 12:54:06 -08:00 committed by Stephen Hemminger
parent dc0332b1e8
commit 8513f4a926
1 changed files with 3 additions and 1 deletions

View File

@ -2068,7 +2068,9 @@ static int iproute_get(int argc, char **argv)
if (req.r.rtm_family == AF_UNSPEC)
req.r.rtm_family = AF_INET;
req.r.rtm_flags |= RTM_F_LOOKUP_TABLE;
/* Only IPv4 supports the RTM_F_LOOKUP_TABLE flag */
if (req.r.rtm_family == AF_INET)
req.r.rtm_flags |= RTM_F_LOOKUP_TABLE;
if (fib_match)
req.r.rtm_flags |= RTM_F_FIB_MATCH;