diff options
author | David S. Miller <davem@davemloft.net> | 2012-06-11 05:01:56 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-06-11 05:10:54 -0400 |
commit | 8b96d22d7a6ec999ae53ae86d829137503ceda65 (patch) | |
tree | d6b0a22c3c5330dfebc793cbb5e13f38787dda5c /net/ipv6/route.c | |
parent | 8e77327783c753689a1a766ab9d301b81c2529f1 (diff) |
inet: Use FIB table peer roots in routes.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/route.c')
-rw-r--r-- | net/ipv6/route.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 17a9b8687f29..d9ba4808f26a 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c | |||
@@ -260,7 +260,8 @@ static struct rt6_info ip6_blk_hole_entry_template = { | |||
260 | /* allocate dst with ip6_dst_ops */ | 260 | /* allocate dst with ip6_dst_ops */ |
261 | static inline struct rt6_info *ip6_dst_alloc(struct net *net, | 261 | static inline struct rt6_info *ip6_dst_alloc(struct net *net, |
262 | struct net_device *dev, | 262 | struct net_device *dev, |
263 | int flags) | 263 | int flags, |
264 | struct fib6_table *table) | ||
264 | { | 265 | { |
265 | struct rt6_info *rt = dst_alloc(&net->ipv6.ip6_dst_ops, dev, | 266 | struct rt6_info *rt = dst_alloc(&net->ipv6.ip6_dst_ops, dev, |
266 | 0, 0, flags); | 267 | 0, 0, flags); |
@@ -268,7 +269,7 @@ static inline struct rt6_info *ip6_dst_alloc(struct net *net, | |||
268 | if (rt) { | 269 | if (rt) { |
269 | memset(&rt->rt6i_table, 0, | 270 | memset(&rt->rt6i_table, 0, |
270 | sizeof(*rt) - sizeof(struct dst_entry)); | 271 | sizeof(*rt) - sizeof(struct dst_entry)); |
271 | rt6_init_peer(rt, net->ipv6.peers); | 272 | rt6_init_peer(rt, table ? &table->tb6_peers : net->ipv6.peers); |
272 | } | 273 | } |
273 | return rt; | 274 | return rt; |
274 | } | 275 | } |
@@ -1114,7 +1115,7 @@ struct dst_entry *icmp6_dst_alloc(struct net_device *dev, | |||
1114 | if (unlikely(!idev)) | 1115 | if (unlikely(!idev)) |
1115 | return ERR_PTR(-ENODEV); | 1116 | return ERR_PTR(-ENODEV); |
1116 | 1117 | ||
1117 | rt = ip6_dst_alloc(net, dev, 0); | 1118 | rt = ip6_dst_alloc(net, dev, 0, NULL); |
1118 | if (unlikely(!rt)) { | 1119 | if (unlikely(!rt)) { |
1119 | in6_dev_put(idev); | 1120 | in6_dev_put(idev); |
1120 | dst = ERR_PTR(-ENOMEM); | 1121 | dst = ERR_PTR(-ENOMEM); |
@@ -1296,7 +1297,7 @@ int ip6_route_add(struct fib6_config *cfg) | |||
1296 | if (!table) | 1297 | if (!table) |
1297 | goto out; | 1298 | goto out; |
1298 | 1299 | ||
1299 | rt = ip6_dst_alloc(net, NULL, DST_NOCOUNT); | 1300 | rt = ip6_dst_alloc(net, NULL, DST_NOCOUNT, table); |
1300 | 1301 | ||
1301 | if (!rt) { | 1302 | if (!rt) { |
1302 | err = -ENOMEM; | 1303 | err = -ENOMEM; |
@@ -1818,7 +1819,8 @@ static struct rt6_info *ip6_rt_copy(struct rt6_info *ort, | |||
1818 | const struct in6_addr *dest) | 1819 | const struct in6_addr *dest) |
1819 | { | 1820 | { |
1820 | struct net *net = dev_net(ort->dst.dev); | 1821 | struct net *net = dev_net(ort->dst.dev); |
1821 | struct rt6_info *rt = ip6_dst_alloc(net, ort->dst.dev, 0); | 1822 | struct rt6_info *rt = ip6_dst_alloc(net, ort->dst.dev, 0, |
1823 | ort->rt6i_table); | ||
1822 | 1824 | ||
1823 | if (rt) { | 1825 | if (rt) { |
1824 | rt->dst.input = ort->dst.input; | 1826 | rt->dst.input = ort->dst.input; |
@@ -2102,7 +2104,7 @@ struct rt6_info *addrconf_dst_alloc(struct inet6_dev *idev, | |||
2102 | bool anycast) | 2104 | bool anycast) |
2103 | { | 2105 | { |
2104 | struct net *net = dev_net(idev->dev); | 2106 | struct net *net = dev_net(idev->dev); |
2105 | struct rt6_info *rt = ip6_dst_alloc(net, net->loopback_dev, 0); | 2107 | struct rt6_info *rt = ip6_dst_alloc(net, net->loopback_dev, 0, NULL); |
2106 | int err; | 2108 | int err; |
2107 | 2109 | ||
2108 | if (!rt) { | 2110 | if (!rt) { |