ipv6/ndisc: join error paths
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
910d30b704
commit
d73f08011b
@ -1538,13 +1538,10 @@ void ndisc_send_redirect(struct sk_buff *skb, struct neighbour *neigh,
|
|||||||
if (rt->rt6i_flags & RTF_GATEWAY) {
|
if (rt->rt6i_flags & RTF_GATEWAY) {
|
||||||
ND_PRINTK2(KERN_WARNING
|
ND_PRINTK2(KERN_WARNING
|
||||||
"ICMPv6 Redirect: destination is not a neighbour.\n");
|
"ICMPv6 Redirect: destination is not a neighbour.\n");
|
||||||
dst_release(dst);
|
goto release;
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!xrlim_allow(dst, 1*HZ)) {
|
|
||||||
dst_release(dst);
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
if (!xrlim_allow(dst, 1*HZ))
|
||||||
|
goto release;
|
||||||
|
|
||||||
if (dev->addr_len) {
|
if (dev->addr_len) {
|
||||||
read_lock_bh(&neigh->lock);
|
read_lock_bh(&neigh->lock);
|
||||||
@ -1570,8 +1567,7 @@ void ndisc_send_redirect(struct sk_buff *skb, struct neighbour *neigh,
|
|||||||
ND_PRINTK0(KERN_ERR
|
ND_PRINTK0(KERN_ERR
|
||||||
"ICMPv6 Redirect: %s() failed to allocate an skb.\n",
|
"ICMPv6 Redirect: %s() failed to allocate an skb.\n",
|
||||||
__func__);
|
__func__);
|
||||||
dst_release(dst);
|
goto release;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
skb_reserve(buff, LL_RESERVED_SPACE(dev));
|
skb_reserve(buff, LL_RESERVED_SPACE(dev));
|
||||||
@ -1631,6 +1627,10 @@ void ndisc_send_redirect(struct sk_buff *skb, struct neighbour *neigh,
|
|||||||
|
|
||||||
if (likely(idev != NULL))
|
if (likely(idev != NULL))
|
||||||
in6_dev_put(idev);
|
in6_dev_put(idev);
|
||||||
|
return;
|
||||||
|
|
||||||
|
release:
|
||||||
|
dst_release(dst);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void pndisc_redo(struct sk_buff *skb)
|
static void pndisc_redo(struct sk_buff *skb)
|
||||||
|
Loading…
Reference in New Issue
Block a user