diff options
author | David Ahern <dsa@cumulusnetworks.com> | 2015-09-02 13:58:35 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-09-15 12:01:41 -0700 |
commit | b7503e0cdb5dbec5d201aa69d8888c14679b5ae8 (patch) | |
tree | 45fde1b18f1b392b12101def200158870687aa71 /net/ipv4/route.c | |
parent | d08c4f355403840fad98d9918db51a7113f38ee8 (diff) |
net: Add FIB table id to rtable
Add the FIB table id to rtable to make the information available for
IPv4 as it is for IPv6.
Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/route.c')
-rw-r--r-- | net/ipv4/route.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index eaefeadce07c..92acc95b7578 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c @@ -1457,6 +1457,7 @@ static struct rtable *rt_dst_alloc(struct net_device *dev, rt->rt_pmtu = 0; rt->rt_gateway = 0; rt->rt_uses_gateway = 0; + rt->rt_table_id = 0; INIT_LIST_HEAD(&rt->rt_uncached); rt->dst.output = ip_output; @@ -1629,6 +1630,8 @@ static int __mkroute_input(struct sk_buff *skb, } rth->rt_is_input = 1; + if (res->table) + rth->rt_table_id = res->table->tb_id; RT_CACHE_STAT_INC(in_slow_tot); rth->dst.input = ip_forward; @@ -1808,6 +1811,8 @@ local_input: rth->dst.tclassid = itag; #endif rth->rt_is_input = 1; + if (res.table) + rth->rt_table_id = res.table->tb_id; RT_CACHE_STAT_INC(in_slow_tot); if (res.type == RTN_UNREACHABLE) { @@ -1988,6 +1993,9 @@ add: return ERR_PTR(-ENOBUFS); rth->rt_iif = orig_oif ? : 0; + if (res->table) + rth->rt_table_id = res->table->tb_id; + RT_CACHE_STAT_INC(out_slow_tot); if (flags & (RTCF_BROADCAST | RTCF_MULTICAST)) { |