Re: unregister_netdevice() and igmpv3 trouble?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>      It's been a while since I've looked at that call path in detail, but
>if memory
>serves, when the interface is going down, the thread that is doing the
>"down" acquires
>a reference to the in_dev, so nothing in the chain should actually have the
>last
>reference-- the in_dev is freed when the last reference is removed in the
>thread that
>caused all of it.

i dont believe this the case anymore.  when i call unregister now it
starts dropping references and sends the NETDEV_UNREGISTER event to
listeners who hsould also drop their references.  the timers use 
__in_dev_put(), so if they hold the last reference, they never call
in_dev_finish_destroy() which drops the last reference to the device.
i believe this is part of the netdev_wait_allrefs() changes.

>reworking to handle those.
>      I'm concerned about checking IFF_UP in the same place as it does the
>all hosts group because a) I'm not sure the flag is cleared at that point
>and b) I'm
>not sure in the v2 case if it currently sends (immediately) leave messages
>that with
>the check might not be sent. A little investigation would turn up the
>answers to those, but

i looked at those.  take a look at dev_close().  the interface is 
is made ~IFF_UP and the NETDEV_DOWN event is sent.  you can be certain
that the interface is going to be down.  if for some reason, you dont
happen to ifdown before unregsitering, unregister also calls dev_close()
if the interface happens to be IFF_UP.  i did look into this a bit.
my current change is just dont try to send leave group messages if the
interface is down.  that just makes no sense.  who are you talking to?

>      Meantime, if you get a chance to try this patch, please let me know
>if it doesn't
>work. I'll do some testing on my own, but haven't done any yet.

dont think this will work.  you will also need to delete the timers
again after ip_mc_destroy_dev() is called since it also goes through
the list of multicast addresses again calling igmp_group_dropped().
ip_mc_destroy_dev() is triggered by the NETDEV_UNREGISTER events via
inetdev_destroy().
-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux