netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fix IGMP version number and timer printing for /proc/net/igmp
@ 2004-04-01 19:39 David Stevens
  2004-04-01 19:50 ` David S. Miller
  0 siblings, 1 reply; 2+ messages in thread
From: David Stevens @ 2004-04-01 19:39 UTC (permalink / raw)
  To: davem, netdev


[-- Attachment #1.1: Type: text/plain, Size: 1397 bytes --]





Below are 2.4.x and 2.6.x patches that correctly print the IGMP
version number and print "0" for the timer value when a timer
is not running.

2.6.x in-line for viewing; both variants attached.

                        +-DLS

diff -ruN linux-2.6.5-rc3/net/ipv4/igmp.c linux-2.6.5-rc3F2/net/ipv4/igmp.c
--- linux-2.6.5-rc3/net/ipv4/igmp.c 2004-03-30 12:27:30.000000000 -0800
+++ linux-2.6.5-rc3F2/net/ipv4/igmp.c     2004-03-31 23:04:49.000000000 -0800
@@ -2225,7 +2225,9 @@
            struct igmp_mc_iter_state *state = igmp_mc_seq_private(seq);
            char   *querier;
 #ifdef CONFIG_IP_MULTICAST
-           querier = IGMP_V1_SEEN(state->in_dev) ? "V1" : "V2";
+           querier = IGMP_V1_SEEN(state->in_dev) ? "V1" :
+                   IGMP_V2_SEEN(state->in_dev) ? "V2" :
+                   "V3";
 #else
            querier = "NONE";
 #endif
@@ -2238,7 +2240,9 @@
            seq_printf(seq,
                     "\t\t\t\t%08lX %5d %d:%08lX\t\t%d\n",
                     im->multiaddr, im->users,
-                    im->tm_running, jiffies_to_clock_t(im->timer.expires-jiffies), im->reporter);
+                    im->tm_running, im->tm_running ?
+                    jiffies_to_clock_t(im->timer.expires-jiffies) : 0,
+                    im->reporter);
      }
      return 0;
 }

(See attached file: 2.4.26rc1-igmpprint.patch)
(See attached file: 2.6.5rc3-igmpprint.patch)

[-- Attachment #1.2: Type: text/html, Size: 1501 bytes --]

[-- Attachment #2: 2.4.26rc1-igmpprint.patch --]
[-- Type: application/octet-stream, Size: 837 bytes --]

diff -ruN linux-2.4.26-rc1/net/ipv4/igmp.c linux-2.4.26-rc1F2/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-rc1F2/net/ipv4/igmp.c	2004-03-31 22:42:33.000000000 -0800
@@ -2128,7 +2128,8 @@
 			continue;
 
 #ifdef CONFIG_IP_MULTICAST
-		querier = IGMP_V1_SEEN(in_dev) ? "V1" : "V2";
+		querier = IGMP_V1_SEEN(in_dev) ? "V1" : IGMP_V2_SEEN(in_dev) ?
+			"V2" : "V3";
 #endif
 
 		len+=sprintf(buffer+len,"%d\t%-10s: %5d %7s\n",
@@ -2139,7 +2140,9 @@
 			len+=sprintf(buffer+len,
 				     "\t\t\t\t%08lX %5d %d:%08lX\t\t%d\n",
 				     im->multiaddr, im->users,
-				     im->tm_running, im->timer.expires-jiffies, im->reporter);
+				     im->tm_running, im->tm_running ?
+				     im->timer.expires-jiffies : 0,
+				     im->reporter);
 
 			pos=begin+len;
 			if(pos<offset)

[-- Attachment #3: 2.6.5rc3-igmpprint.patch --]
[-- Type: application/octet-stream, Size: 896 bytes --]

diff -ruN linux-2.6.5-rc3/net/ipv4/igmp.c linux-2.6.5-rc3F2/net/ipv4/igmp.c
--- linux-2.6.5-rc3/net/ipv4/igmp.c	2004-03-30 12:27:30.000000000 -0800
+++ linux-2.6.5-rc3F2/net/ipv4/igmp.c	2004-03-31 23:04:49.000000000 -0800
@@ -2225,7 +2225,9 @@
 		struct igmp_mc_iter_state *state = igmp_mc_seq_private(seq);
 		char   *querier;
 #ifdef CONFIG_IP_MULTICAST
-		querier = IGMP_V1_SEEN(state->in_dev) ? "V1" : "V2";
+		querier = IGMP_V1_SEEN(state->in_dev) ? "V1" :
+			  IGMP_V2_SEEN(state->in_dev) ? "V2" :
+			  "V3";
 #else
 		querier = "NONE";
 #endif
@@ -2238,7 +2240,9 @@
 		seq_printf(seq,
 			   "\t\t\t\t%08lX %5d %d:%08lX\t\t%d\n",
 			   im->multiaddr, im->users,
-			   im->tm_running, jiffies_to_clock_t(im->timer.expires-jiffies), im->reporter);
+			   im->tm_running, im->tm_running ?
+			   jiffies_to_clock_t(im->timer.expires-jiffies) : 0,
+			   im->reporter);
 	}
 	return 0;
 }

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] fix IGMP version number and timer printing for /proc/net/igmp
  2004-04-01 19:39 [PATCH] fix IGMP version number and timer printing for /proc/net/igmp David Stevens
@ 2004-04-01 19:50 ` David S. Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David S. Miller @ 2004-04-01 19:50 UTC (permalink / raw)
  To: David Stevens; +Cc: netdev


Applied, thanks David.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-04-01 19:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-04-01 19:39 [PATCH] fix IGMP version number and timer printing for /proc/net/igmp David Stevens
2004-04-01 19:50 ` David S. Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).