]> git.hungrycats.org Git - linux/commitdiff
[IGMP]: Do nothing in ip_mc_down() if ip_mc_up() was not called previously.
authorDavid S. Miller <davem@nuts.davemloft.net>
Thu, 25 Mar 2004 07:06:22 +0000 (23:06 -0800)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Thu, 25 Mar 2004 07:06:22 +0000 (23:06 -0800)
include/linux/inetdevice.h
net/ipv4/igmp.c

index c23cd45da7eb76805f8c552ea03630515d676e14..2620f45ca1f673efdd4c25480e68ae42e74c6bbf 100644 (file)
@@ -36,6 +36,8 @@ struct in_device
        rwlock_t                lock;
        int                     dead;
        struct in_ifaddr        *ifa_list;      /* IP ifaddr chain              */
+       int                     mc_initted;
+
        struct ip_mc_list       *mc_list;       /* IP multicast filter chain    */
        rwlock_t                mc_lock;        /* for mc_tomb */
        struct ip_mc_list       *mc_tomb;
index 99e67b2cf9f78d24cb906c452b46adbf205a4918..a96d403c7ec781f0a04402744bc46271c8b3c277 100644 (file)
@@ -1217,6 +1217,9 @@ void ip_mc_down(struct in_device *in_dev)
 
        ASSERT_RTNL();
 
+       if (!in_dev->mc_initted)
+               return;
+
 #ifdef CONFIG_IP_MULTICAST
        in_dev->mr_ifc_count = 0;
        if (del_timer(&in_dev->mr_ifc_timer))
@@ -1262,6 +1265,8 @@ void ip_mc_up(struct in_device *in_dev)
 
        for (i=in_dev->mc_list; i; i=i->next)
                igmp_group_added(i);
+
+       in_dev->mc_initted = 1;
 }
 
 /*