net: Set rtm_table to RT_TABLE_COMPAT for ipv6 for tables > 255
authorKalash Nainwal <kalash@arista.com>
Thu, 21 Feb 2019 00:23:04 +0000 (16:23 -0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 22 Feb 2019 23:21:27 +0000 (15:21 -0800)
Set rtm_table to RT_TABLE_COMPAT for ipv6 for tables > 255 to
keep legacy software happy. This is similar to what was done for
ipv4 in commit 94f813c3b106 ("net: Fix routing tables with
id > 255 for legacy software").

Signed-off-by: Kalash Nainwal <kalash@arista.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/route.c

index 047c47224dba5eee24de524334fcc24844198331..ce15dc4ccbfa0cc14233b1fe7842479726ffed5a 100644 (file)
@@ -4665,7 +4665,7 @@ static int rt6_fill_node(struct net *net, struct sk_buff *skb,
                table = rt->fib6_table->tb6_id;
        else
                table = RT6_TABLE_UNSPEC;
-       rtm->rtm_table = table;
+       rtm->rtm_table = table < 256 ? table : RT_TABLE_COMPAT;
        if (nla_put_u32(skb, RTA_TABLE, table))
                goto nla_put_failure;