Commit 6e4153af authored by David S. Miller's avatar David S. Miller

[IPV6]: Fix dst reference counting in ndisc_send_redirect().

parent dc8b8b54
......@@ -1321,7 +1321,6 @@ void ndisc_send_redirect(struct sk_buff *skb, struct neighbour *neigh,
if (rt == NULL)
return;
dst = &rt->u.dst;
dst_clone(dst);
err = xfrm_lookup(&dst, &fl, NULL, 0);
if (err) {
......@@ -1329,16 +1328,17 @@ void ndisc_send_redirect(struct sk_buff *skb, struct neighbour *neigh,
return;
}
rt = (struct rt6_info *) dst;
if (rt->rt6i_flags & RTF_GATEWAY) {
ND_PRINTK1("ndisc_send_redirect: not a neighbour\n");
dst_release(&rt->u.dst);
dst_release(dst);
return;
}
if (!xrlim_allow(&rt->u.dst, 1*HZ)) {
dst_release(&rt->u.dst);
if (!xrlim_allow(dst, 1*HZ)) {
dst_release(dst);
return;
}
dst_release(&rt->u.dst);
if (dev->addr_len) {
if (neigh->nud_state&NUD_VALID) {
......@@ -1348,6 +1348,7 @@ void ndisc_send_redirect(struct sk_buff *skb, struct neighbour *neigh,
We will make it later, when will be sure,
that it is alive.
*/
dst_release(dst);
return;
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment