Commit 439e2385 authored by Denis V. Lunev's avatar Denis V. Lunev Committed by David S. Miller

[IPV6]: Event type in addrconf_ifdown is mis-used.

addrconf_ifdown is broken in respect to the usage of how
parameter. This function is called with (event != NETDEV_DOWN) and (2)
on the IPv6 stop.  It the latter case inet6_dev from loopback device
should be destroyed.
Signed-off-by: default avatarDenis V. Lunev <den@openvz.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent af268182
...@@ -2469,7 +2469,7 @@ static int addrconf_ifdown(struct net_device *dev, int how) ...@@ -2469,7 +2469,7 @@ static int addrconf_ifdown(struct net_device *dev, int how)
/* Step 1: remove reference to ipv6 device from parent device. /* Step 1: remove reference to ipv6 device from parent device.
Do not dev_put! Do not dev_put!
*/ */
if (how == 1) { if (how) {
idev->dead = 1; idev->dead = 1;
/* protected by rtnl_lock */ /* protected by rtnl_lock */
...@@ -2501,12 +2501,12 @@ static int addrconf_ifdown(struct net_device *dev, int how) ...@@ -2501,12 +2501,12 @@ static int addrconf_ifdown(struct net_device *dev, int how)
write_lock_bh(&idev->lock); write_lock_bh(&idev->lock);
/* Step 3: clear flags for stateless addrconf */ /* Step 3: clear flags for stateless addrconf */
if (how != 1) if (!how)
idev->if_flags &= ~(IF_RS_SENT|IF_RA_RCVD|IF_READY); idev->if_flags &= ~(IF_RS_SENT|IF_RA_RCVD|IF_READY);
/* Step 4: clear address list */ /* Step 4: clear address list */
#ifdef CONFIG_IPV6_PRIVACY #ifdef CONFIG_IPV6_PRIVACY
if (how == 1 && del_timer(&idev->regen_timer)) if (how && del_timer(&idev->regen_timer))
in6_dev_put(idev); in6_dev_put(idev);
/* clear tempaddr list */ /* clear tempaddr list */
...@@ -2543,7 +2543,7 @@ static int addrconf_ifdown(struct net_device *dev, int how) ...@@ -2543,7 +2543,7 @@ static int addrconf_ifdown(struct net_device *dev, int how)
/* Step 5: Discard multicast list */ /* Step 5: Discard multicast list */
if (how == 1) if (how)
ipv6_mc_destroy_dev(idev); ipv6_mc_destroy_dev(idev);
else else
ipv6_mc_down(idev); ipv6_mc_down(idev);
...@@ -2552,7 +2552,7 @@ static int addrconf_ifdown(struct net_device *dev, int how) ...@@ -2552,7 +2552,7 @@ static int addrconf_ifdown(struct net_device *dev, int how)
/* Shot the device (if unregistered) */ /* Shot the device (if unregistered) */
if (how == 1) { if (how) {
addrconf_sysctl_unregister(idev); addrconf_sysctl_unregister(idev);
neigh_parms_release(&nd_tbl, idev->nd_parms); neigh_parms_release(&nd_tbl, idev->nd_parms);
neigh_ifdown(&nd_tbl, dev); neigh_ifdown(&nd_tbl, dev);
......
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