Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 279130
b: refs/heads/master
c: 8ade06c
h: refs/heads/master
v: v3
  • Loading branch information
David S. Miller committed Dec 29, 2011
1 parent 0a31e3f commit e806137
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f1776dade17cd54562f4bc1d01de89c4908b4dd0
refs/heads/master: 8ade06c616b34b4237c0ed77d1ff0ce04ad7d056
17 changes: 10 additions & 7 deletions trunk/net/ipv6/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,14 @@ static struct neighbour *ip6_neigh_lookup(const struct dst_entry *dst, const voi
return neigh_create(&nd_tbl, daddr, dst->dev);
}

static int rt6_bind_neighbour(struct rt6_info *rt)
static int rt6_bind_neighbour(struct rt6_info *rt, struct net_device *dev)
{
struct neighbour *n = ip6_neigh_lookup(&rt->dst, &rt->rt6i_gateway);
if (IS_ERR(n))
return PTR_ERR(n);
struct neighbour *n = __ipv6_neigh_lookup(&nd_tbl, dev, &rt->rt6i_gateway);
if (!n) {
n = neigh_create(&nd_tbl, &rt->rt6i_gateway, dev);
if (IS_ERR(n))
return PTR_ERR(n);
}
dst_set_neighbour(&rt->dst, n);

return 0;
Expand Down Expand Up @@ -746,7 +749,7 @@ static struct rt6_info *rt6_alloc_cow(const struct rt6_info *ort,
#endif

retry:
if (rt6_bind_neighbour(rt)) {
if (rt6_bind_neighbour(rt, rt->dst.dev)) {
struct net *net = dev_net(rt->dst.dev);
int saved_rt_min_interval =
net->ipv6.sysctl.ip6_rt_gc_min_interval;
Expand Down Expand Up @@ -1397,7 +1400,7 @@ int ip6_route_add(struct fib6_config *cfg)
rt->rt6i_prefsrc.plen = 0;

if (cfg->fc_flags & (RTF_GATEWAY | RTF_NONEXTHOP)) {
err = rt6_bind_neighbour(rt);
err = rt6_bind_neighbour(rt, dev);
if (err)
goto out;
}
Expand Down Expand Up @@ -2084,7 +2087,7 @@ struct rt6_info *addrconf_dst_alloc(struct inet6_dev *idev,
rt->rt6i_flags |= RTF_ANYCAST;
else
rt->rt6i_flags |= RTF_LOCAL;
err = rt6_bind_neighbour(rt);
err = rt6_bind_neighbour(rt, rt->dst.dev);
if (err) {
dst_free(&rt->dst);
return ERR_PTR(err);
Expand Down

0 comments on commit e806137

Please sign in to comment.