summaryrefslogtreecommitdiffstats
path: root/net/ipv4/route.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2012-06-11 05:01:56 -0400
committerDavid S. Miller <davem@davemloft.net>2012-06-11 05:10:54 -0400
commit8b96d22d7a6ec999ae53ae86d829137503ceda65 (patch)
treed6b0a22c3c5330dfebc793cbb5e13f38787dda5c /net/ipv4/route.c
parent8e77327783c753689a1a766ab9d301b81c2529f1 (diff)
inet: Use FIB table peer roots in routes.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/route.c')
-rw-r--r--net/ipv4/route.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 456a9470fb54..4c33ce3000ed 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -2125,7 +2125,7 @@ static int __mkroute_input(struct sk_buff *skb,
2125 rth->rt_gateway = daddr; 2125 rth->rt_gateway = daddr;
2126 rth->rt_spec_dst= spec_dst; 2126 rth->rt_spec_dst= spec_dst;
2127 rth->rt_peer_genid = 0; 2127 rth->rt_peer_genid = 0;
2128 rt_init_peer(rth, dev_net(rth->dst.dev)->ipv4.peers); 2128 rt_init_peer(rth, &res->table->tb_peers);
2129 rth->fi = NULL; 2129 rth->fi = NULL;
2130 2130
2131 rth->dst.input = ip_forward; 2131 rth->dst.input = ip_forward;
@@ -2512,7 +2512,9 @@ static struct rtable *__mkroute_output(const struct fib_result *res,
2512 rth->rt_gateway = fl4->daddr; 2512 rth->rt_gateway = fl4->daddr;
2513 rth->rt_spec_dst= fl4->saddr; 2513 rth->rt_spec_dst= fl4->saddr;
2514 rth->rt_peer_genid = 0; 2514 rth->rt_peer_genid = 0;
2515 rt_init_peer(rth, dev_net(dev_out)->ipv4.peers); 2515 rt_init_peer(rth, (res->table ?
2516 &res->table->tb_peers :
2517 dev_net(dev_out)->ipv4.peers));
2516 rth->fi = NULL; 2518 rth->fi = NULL;
2517 2519
2518 RT_CACHE_STAT_INC(out_slow_tot); 2520 RT_CACHE_STAT_INC(out_slow_tot);
@@ -2561,6 +2563,7 @@ static struct rtable *ip_route_output_slow(struct net *net, struct flowi4 *fl4)
2561 int orig_oif; 2563 int orig_oif;
2562 2564
2563 res.fi = NULL; 2565 res.fi = NULL;
2566 res.table = NULL;
2564#ifdef CONFIG_IP_MULTIPLE_TABLES 2567#ifdef CONFIG_IP_MULTIPLE_TABLES
2565 res.r = NULL; 2568 res.r = NULL;
2566#endif 2569#endif
@@ -2666,6 +2669,7 @@ static struct rtable *ip_route_output_slow(struct net *net, struct flowi4 *fl4)
2666 2669
2667 if (fib_lookup(net, fl4, &res)) { 2670 if (fib_lookup(net, fl4, &res)) {
2668 res.fi = NULL; 2671 res.fi = NULL;
2672 res.table = NULL;
2669 if (fl4->flowi4_oif) { 2673 if (fl4->flowi4_oif) {
2670 /* Apparently, routing tables are wrong. Assume, 2674 /* Apparently, routing tables are wrong. Assume,
2671 that the destination is on link. 2675 that the destination is on link.