diff options
Diffstat (limited to 'net/ipv6/addrconf.c')
-rw-r--r-- | net/ipv6/addrconf.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index e7a1882db048..a65935a9afd9 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c | |||
@@ -2456,7 +2456,7 @@ static int addrconf_ifdown(struct net_device *dev, int how) | |||
2456 | 2456 | ||
2457 | ASSERT_RTNL(); | 2457 | ASSERT_RTNL(); |
2458 | 2458 | ||
2459 | if (dev == init_net.loopback_dev && how == 1) | 2459 | if ((dev->flags & IFF_LOOPBACK) && how == 1) |
2460 | how = 0; | 2460 | how = 0; |
2461 | 2461 | ||
2462 | rt6_ifdown(dev); | 2462 | rt6_ifdown(dev); |
@@ -2469,7 +2469,7 @@ static int addrconf_ifdown(struct net_device *dev, int how) | |||
2469 | /* Step 1: remove reference to ipv6 device from parent device. | 2469 | /* Step 1: remove reference to ipv6 device from parent device. |
2470 | Do not dev_put! | 2470 | Do not dev_put! |
2471 | */ | 2471 | */ |
2472 | if (how == 1) { | 2472 | if (how) { |
2473 | idev->dead = 1; | 2473 | idev->dead = 1; |
2474 | 2474 | ||
2475 | /* protected by rtnl_lock */ | 2475 | /* protected by rtnl_lock */ |
@@ -2501,12 +2501,12 @@ static int addrconf_ifdown(struct net_device *dev, int how) | |||
2501 | write_lock_bh(&idev->lock); | 2501 | write_lock_bh(&idev->lock); |
2502 | 2502 | ||
2503 | /* Step 3: clear flags for stateless addrconf */ | 2503 | /* Step 3: clear flags for stateless addrconf */ |
2504 | if (how != 1) | 2504 | if (!how) |
2505 | idev->if_flags &= ~(IF_RS_SENT|IF_RA_RCVD|IF_READY); | 2505 | idev->if_flags &= ~(IF_RS_SENT|IF_RA_RCVD|IF_READY); |
2506 | 2506 | ||
2507 | /* Step 4: clear address list */ | 2507 | /* Step 4: clear address list */ |
2508 | #ifdef CONFIG_IPV6_PRIVACY | 2508 | #ifdef CONFIG_IPV6_PRIVACY |
2509 | if (how == 1 && del_timer(&idev->regen_timer)) | 2509 | if (how && del_timer(&idev->regen_timer)) |
2510 | in6_dev_put(idev); | 2510 | in6_dev_put(idev); |
2511 | 2511 | ||
2512 | /* clear tempaddr list */ | 2512 | /* clear tempaddr list */ |
@@ -2543,7 +2543,7 @@ static int addrconf_ifdown(struct net_device *dev, int how) | |||
2543 | 2543 | ||
2544 | /* Step 5: Discard multicast list */ | 2544 | /* Step 5: Discard multicast list */ |
2545 | 2545 | ||
2546 | if (how == 1) | 2546 | if (how) |
2547 | ipv6_mc_destroy_dev(idev); | 2547 | ipv6_mc_destroy_dev(idev); |
2548 | else | 2548 | else |
2549 | ipv6_mc_down(idev); | 2549 | ipv6_mc_down(idev); |
@@ -2552,7 +2552,7 @@ static int addrconf_ifdown(struct net_device *dev, int how) | |||
2552 | 2552 | ||
2553 | /* Shot the device (if unregistered) */ | 2553 | /* Shot the device (if unregistered) */ |
2554 | 2554 | ||
2555 | if (how == 1) { | 2555 | if (how) { |
2556 | addrconf_sysctl_unregister(idev); | 2556 | addrconf_sysctl_unregister(idev); |
2557 | neigh_parms_release(&nd_tbl, idev->nd_parms); | 2557 | neigh_parms_release(&nd_tbl, idev->nd_parms); |
2558 | neigh_ifdown(&nd_tbl, dev); | 2558 | neigh_ifdown(&nd_tbl, dev); |