Thread (4 messages) 4 messages, 2 authors, 2004-04-01

Re: [PATCH] fix IGMPv3 timer initialization when device not "upped"

From: David Stevens <hidden>
Date: 2004-04-01 06:10:22






netdev-bounce@oss.sgi.com wrote on 03/30/2004 07:25:58 PM:
Applied, thanks David.  Can I have a 2.4.x variant under seperate
cover please?  I did the "mc_initted" thing there too.
Dave,
      Here's a 2.4.x version of the patch.

                        +-DLS

diff -ruN linux-2.4.26-rc1/include/linux/inetdevice.h
linux-2.4.26-rc1F1/include/linux/inetdevice.h
--- linux-2.4.26-rc1/include/linux/inetdevice.h 2004-03-30
16:28:38.000000000 -0800
+++ linux-2.4.26-rc1F1/include/linux/inetdevice.h     2004-03-31
19:33:34.000000000 -0800
@@ -34,8 +34,6 @@
      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;
diff -ruN linux-2.4.26-rc1/net/ipv4/devinet.c
linux-2.4.26-rc1F1/net/ipv4/devinet.c
--- linux-2.4.26-rc1/net/ipv4/devinet.c   2004-03-30 16:28:39.000000000
-0800
+++ linux-2.4.26-rc1F1/net/ipv4/devinet.c 2004-03-31 19:35:38.000000000
-0800
@@ -151,7 +151,8 @@
 #ifdef CONFIG_SYSCTL
      devinet_sysctl_register(in_dev, &in_dev->cnf);
 #endif
-     if (dev->flags&IFF_UP)
+     ip_mc_init_dev(in_dev);
+     if (dev->flags & IFF_UP)
            ip_mc_up(in_dev);
      return in_dev;
 }
diff -ruN linux-2.4.26-rc1/net/ipv4/igmp.c
linux-2.4.26-rc1F1/net/ipv4/igmp.c
--- linux-2.4.26-rc1/net/ipv4/igmp.c      2004-03-30 16:28:39.000000000 -0800
+++ linux-2.4.26-rc1F1/net/ipv4/igmp.c    2004-03-31 19:33:34.000000000 -0800
@@ -1205,8 +1205,8 @@

      ASSERT_RTNL();

-     if (!in_dev->mc_initted)
-           return;
+     for (i=in_dev->mc_list; i; i=i->next)
+           igmp_group_dropped(i);

 #ifdef CONFIG_IP_MULTICAST
      in_dev->mr_ifc_count = 0;
@@ -1215,24 +1215,14 @@
      in_dev->mr_gq_running = 0;
      if (del_timer(&in_dev->mr_gq_timer))
            __in_dev_put(in_dev);
-#endif
-
-     for (i=in_dev->mc_list; i; i=i->next)
-           igmp_group_dropped(i);
-
-#ifdef CONFIG_IP_MULTICAST
      igmpv3_clear_delrec(in_dev);
 #endif

      ip_mc_dec_group(in_dev, IGMP_ALL_HOSTS);
 }

-/* Device going up */
-
-void ip_mc_up(struct in_device *in_dev)
+void ip_mc_init_dev(struct in_device *in_dev)
 {
-     struct ip_mc_list *i;
-
      ASSERT_RTNL();

      in_dev->mc_tomb = 0;
@@ -1249,12 +1239,20 @@
 #endif

      in_dev->mc_lock = RW_LOCK_UNLOCKED;
+}
+
+/* Device going up */
+
+void ip_mc_up(struct in_device *in_dev)
+{
+     struct ip_mc_list *i;
+
+     ASSERT_RTNL();
+
      ip_mc_inc_group(in_dev, IGMP_ALL_HOSTS);

      for (i=in_dev->mc_list; i; i=i->next)
            igmp_group_added(i);
-
-     in_dev->mc_initted = 1;
 }

 /*
(See attached file: 2.4.26-rc1-igmpinit.patch)

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help