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, ...@@ -1321,7 +1321,6 @@ void ndisc_send_redirect(struct sk_buff *skb, struct neighbour *neigh,
if (rt == NULL) if (rt == NULL)
return; return;
dst = &rt->u.dst; dst = &rt->u.dst;
dst_clone(dst);
err = xfrm_lookup(&dst, &fl, NULL, 0); err = xfrm_lookup(&dst, &fl, NULL, 0);
if (err) { if (err) {
...@@ -1329,16 +1328,17 @@ void ndisc_send_redirect(struct sk_buff *skb, struct neighbour *neigh, ...@@ -1329,16 +1328,17 @@ void ndisc_send_redirect(struct sk_buff *skb, struct neighbour *neigh,
return; return;
} }
rt = (struct rt6_info *) dst;
if (rt->rt6i_flags & RTF_GATEWAY) { if (rt->rt6i_flags & RTF_GATEWAY) {
ND_PRINTK1("ndisc_send_redirect: not a neighbour\n"); ND_PRINTK1("ndisc_send_redirect: not a neighbour\n");
dst_release(&rt->u.dst); dst_release(dst);
return; return;
} }
if (!xrlim_allow(&rt->u.dst, 1*HZ)) { if (!xrlim_allow(dst, 1*HZ)) {
dst_release(&rt->u.dst); dst_release(dst);
return; return;
} }
dst_release(&rt->u.dst);
if (dev->addr_len) { if (dev->addr_len) {
if (neigh->nud_state&NUD_VALID) { if (neigh->nud_state&NUD_VALID) {
...@@ -1348,6 +1348,7 @@ void ndisc_send_redirect(struct sk_buff *skb, struct neighbour *neigh, ...@@ -1348,6 +1348,7 @@ void ndisc_send_redirect(struct sk_buff *skb, struct neighbour *neigh,
We will make it later, when will be sure, We will make it later, when will be sure,
that it is alive. that it is alive.
*/ */
dst_release(dst);
return; 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