Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 289781
b: refs/heads/master
c: 4991969
h: refs/heads/master
i:
  289779: f734ebe
v: v3
  • Loading branch information
David S. Miller committed Jan 28, 2012
1 parent 9ce1c22 commit 9a77a92
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 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: 5339ab8b1dd82f14df168fb9bf59449f3e24b03d
refs/heads/master: 4991969a1027826c3db19dd3e600e145603e6928
1 change: 0 additions & 1 deletion trunk/include/net/ndisc.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ extern void ndisc_send_rs(struct net_device *dev,
const struct in6_addr *daddr);

extern void ndisc_send_redirect(struct sk_buff *skb,
struct neighbour *neigh,
const struct in6_addr *target);

extern int ndisc_mc_map(const struct in6_addr *addr, char *buf,
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/ipv6/ip6_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ int ip6_forward(struct sk_buff *skb)
and by source (inside ndisc_send_redirect)
*/
if (inet_peer_xrlim_allow(rt->rt6i_peer, 1*HZ))
ndisc_send_redirect(skb, n, target);
ndisc_send_redirect(skb, target);
} else {
int addrtype = ipv6_addr_type(&hdr->saddr);

Expand Down
12 changes: 10 additions & 2 deletions trunk/net/ipv6/ndisc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1512,8 +1512,7 @@ static void ndisc_redirect_rcv(struct sk_buff *skb)
}
}

void ndisc_send_redirect(struct sk_buff *skb, struct neighbour *neigh,
const struct in6_addr *target)
void ndisc_send_redirect(struct sk_buff *skb, const struct in6_addr *target)
{
struct net_device *dev = skb->dev;
struct net *net = dev_net(dev);
Expand Down Expand Up @@ -1571,6 +1570,13 @@ void ndisc_send_redirect(struct sk_buff *skb, struct neighbour *neigh,
goto release;

if (dev->addr_len) {
struct neighbour *neigh = dst_neigh_lookup(skb_dst(skb), target);
if (!neigh) {
ND_PRINTK2(KERN_WARNING
"ICMPv6 Redirect: no neigh for target address\n");
goto release;
}

read_lock_bh(&neigh->lock);
if (neigh->nud_state & NUD_VALID) {
memcpy(ha_buf, neigh->ha, dev->addr_len);
Expand All @@ -1579,6 +1585,8 @@ void ndisc_send_redirect(struct sk_buff *skb, struct neighbour *neigh,
len += ndisc_opt_addr_space(dev);
} else
read_unlock_bh(&neigh->lock);

neigh_release(neigh);
}

rd_len = min_t(unsigned int,
Expand Down

0 comments on commit 9a77a92

Please sign in to comment.