diff options
author | Sabrina Dubroca <sd@queasysnail.net> | 2014-09-10 17:23:02 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-09-12 17:33:06 -0400 |
commit | 381f4dca48d23e155b936b86ccd3ff12f073cf0f (patch) | |
tree | b6f2de835f42420ad2d374c8ec91da74de2ba988 /net/ipv6/addrconf.c | |
parent | dcbc0054d783d53cf0479c391334e9a478daa25f (diff) |
ipv6: clean up anycast when an interface is destroyed
If we try to rmmod the driver for an interface while sockets with
setsockopt(JOIN_ANYCAST) are alive, some refcounts aren't cleaned up
and we get stuck on:
unregister_netdevice: waiting for ens3 to become free. Usage count = 1
If we LEAVE_ANYCAST/close everything before rmmod'ing, there is no
problem.
We need to perform a cleanup similar to the one for multicast in
addrconf_ifdown(how == 1).
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/addrconf.c')
-rw-r--r-- | net/ipv6/addrconf.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index fc1fac2a0528..3342ee64f2e3 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c | |||
@@ -3094,11 +3094,13 @@ static int addrconf_ifdown(struct net_device *dev, int how) | |||
3094 | 3094 | ||
3095 | write_unlock_bh(&idev->lock); | 3095 | write_unlock_bh(&idev->lock); |
3096 | 3096 | ||
3097 | /* Step 5: Discard multicast list */ | 3097 | /* Step 5: Discard anycast and multicast list */ |
3098 | if (how) | 3098 | if (how) { |
3099 | ipv6_ac_destroy_dev(idev); | ||
3099 | ipv6_mc_destroy_dev(idev); | 3100 | ipv6_mc_destroy_dev(idev); |
3100 | else | 3101 | } else { |
3101 | ipv6_mc_down(idev); | 3102 | ipv6_mc_down(idev); |
3103 | } | ||
3102 | 3104 | ||
3103 | idev->tstamp = jiffies; | 3105 | idev->tstamp = jiffies; |
3104 | 3106 | ||