* MLDv1 /proc/net/igmp6 timer printing [PATCH]
@ 2003-11-19 4:55 David Stevens
2003-11-19 6:57 ` David S. Miller
0 siblings, 1 reply; 4+ messages in thread
From: David Stevens @ 2003-11-19 4:55 UTC (permalink / raw)
To: davem, netdev
[-- Attachment #1: Type: text/plain, Size: 1154 bytes --]
Dave,
This is a bug, but mostly cosmetic, and it appears to have
been there forever. It wasted a couple minutes for me because I
expected the igmp6 file would list the timer correctly when it's
running, but because of this bug, it doesn't. Let me know if I should
hold it until later.
The problem is the IPv6 multicast address flag
"MAF_TIMER_RUNNING" is set on a join_group, and cleared
by a report, but is never set again (e.g., from a query). The timer
is set and running, but the /proc entry won't show it because it
only reports the time left on the timer if the flag is set.
Fix is to set the flag when the timer is set.
+-DLS
--- linux-2.6.0-test9-bk12/net/ipv6/mcast.c 2003-11-07 14:13:21.000000000 -0800
+++ linux-2.6.0-test9-bk12F1/net/ipv6/mcast.c 2003-11-18 20:38:00.000000000 -0800
@@ -978,6 +978,7 @@
ma->mca_timer.expires = jiffies + delay;
if (!mod_timer(&ma->mca_timer, jiffies + delay))
atomic_inc(&ma->mca_refcnt);
+ ma->mca_flags |= MAF_TIMER_RUNNING;
}
static void mld_marksources(struct ifmcaddr6 *pmc, int nsrcs,
(See attached file: mldtr.patch)
[-- Attachment #2: mldtr.patch --]
[-- Type: application/octet-stream, Size: 414 bytes --]
--- linux-2.6.0-test9-bk12/net/ipv6/mcast.c 2003-11-07 14:13:21.000000000 -0800
+++ linux-2.6.0-test9-bk12F1/net/ipv6/mcast.c 2003-11-18 20:38:00.000000000 -0800
@@ -978,6 +978,7 @@
ma->mca_timer.expires = jiffies + delay;
if (!mod_timer(&ma->mca_timer, jiffies + delay))
atomic_inc(&ma->mca_refcnt);
+ ma->mca_flags |= MAF_TIMER_RUNNING;
}
static void mld_marksources(struct ifmcaddr6 *pmc, int nsrcs,
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: MLDv1 /proc/net/igmp6 timer printing [PATCH]
2003-11-19 4:55 MLDv1 /proc/net/igmp6 timer printing [PATCH] David Stevens
@ 2003-11-19 6:57 ` David S. Miller
0 siblings, 0 replies; 4+ messages in thread
From: David S. Miller @ 2003-11-19 6:57 UTC (permalink / raw)
To: David Stevens; +Cc: netdev
On Tue, 18 Nov 2003 21:55:40 -0700
David Stevens <dlstevens@us.ibm.com> wrote:
> The problem is the IPv6 multicast address flag
> "MAF_TIMER_RUNNING" is set on a join_group, and cleared
> by a report, but is never set again (e.g., from a query). The timer
> is set and running, but the /proc entry won't show it because it
> only reports the time left on the timer if the flag is set.
> Fix is to set the flag when the timer is set.
I want to apply this, but I'd like to ask you to fix a related
issue at the same time. The jiffies reported to userspace by
this multicast code does not convert HZ to USER_HZ, just include
linux/times.h and use jiffies_to_clock_t().
We recently had to fix similar issues in other networking procfs
files.
Thanks David.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: MLDv1 /proc/net/igmp6 timer printing [PATCH]
@ 2003-11-19 7:59 David Stevens
2003-11-19 8:05 ` YOSHIFUJI Hideaki / 吉藤英明
0 siblings, 1 reply; 4+ messages in thread
From: David Stevens @ 2003-11-19 7:59 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev
[-- Attachment #1: Type: text/plain, Size: 1111 bytes --]
Ok, here's the revised patch.
+-DLS
--- linux-2.6.0-test9-bk23/net/ipv6/mcast.c 2003-11-18 23:20:56.000000000 -0800
+++ linux-2.6.0-test9-bk23F1/net/ipv6/mcast.c 2003-11-18 23:30:18.573414608 -0800
@@ -36,6 +36,7 @@
#include <linux/socket.h>
#include <linux/sockios.h>
#include <linux/jiffies.h>
+#include <linux/times.h>
#include <linux/net.h>
#include <linux/in.h>
#include <linux/in6.h>
@@ -978,6 +979,7 @@
ma->mca_timer.expires = jiffies + delay;
if (!mod_timer(&ma->mca_timer, jiffies + delay))
atomic_inc(&ma->mca_refcnt);
+ ma->mca_flags |= MAF_TIMER_RUNNING;
}
static void mld_marksources(struct ifmcaddr6 *pmc, int nsrcs,
@@ -2157,7 +2159,8 @@
state->dev->ifindex, state->dev->name,
NIP6(im->mca_addr),
im->mca_users, im->mca_flags,
- (im->mca_flags&MAF_TIMER_RUNNING) ? im->mca_timer.expires-jiffies : 0);
+ (im->mca_flags&MAF_TIMER_RUNNING) ?
+ jiffies_to_clock_t(im->mca_timer.expires-jiffies) : 0);
return 0;
}
(See attached file: mld2tr2.patch)
[-- Attachment #2: mld2tr2.patch --]
[-- Type: application/octet-stream, Size: 940 bytes --]
--- linux-2.6.0-test9-bk23/net/ipv6/mcast.c 2003-11-18 23:20:56.000000000 -0800
+++ linux-2.6.0-test9-bk23F1/net/ipv6/mcast.c 2003-11-18 23:30:18.573414608 -0800
@@ -36,6 +36,7 @@
#include <linux/socket.h>
#include <linux/sockios.h>
#include <linux/jiffies.h>
+#include <linux/times.h>
#include <linux/net.h>
#include <linux/in.h>
#include <linux/in6.h>
@@ -978,6 +979,7 @@
ma->mca_timer.expires = jiffies + delay;
if (!mod_timer(&ma->mca_timer, jiffies + delay))
atomic_inc(&ma->mca_refcnt);
+ ma->mca_flags |= MAF_TIMER_RUNNING;
}
static void mld_marksources(struct ifmcaddr6 *pmc, int nsrcs,
@@ -2157,7 +2159,8 @@
state->dev->ifindex, state->dev->name,
NIP6(im->mca_addr),
im->mca_users, im->mca_flags,
- (im->mca_flags&MAF_TIMER_RUNNING) ? im->mca_timer.expires-jiffies : 0);
+ (im->mca_flags&MAF_TIMER_RUNNING) ?
+ jiffies_to_clock_t(im->mca_timer.expires-jiffies) : 0);
return 0;
}
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: MLDv1 /proc/net/igmp6 timer printing [PATCH]
2003-11-19 7:59 David Stevens
@ 2003-11-19 8:05 ` YOSHIFUJI Hideaki / 吉藤英明
0 siblings, 0 replies; 4+ messages in thread
From: YOSHIFUJI Hideaki / 吉藤英明 @ 2003-11-19 8:05 UTC (permalink / raw)
To: dlstevens; +Cc: davem, netdev
In article <OFC259A8D3.0F02136D-ON88256DE3.002BA960@us.ibm.com> (at Wed, 19 Nov 2003 00:59:20 -0700), David Stevens <dlstevens@us.ibm.com> says:
> Ok, here's the revised patch.
please fix ipv4 as well.
Index: net/ipv4/igmp.c
===================================================================
RCS file: /cvsroot/usagi/usagi/kernel/linux26/net/ipv4/igmp.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- net/ipv4/igmp.c 9 Oct 2003 02:49:24 -0000 1.20
+++ net/ipv4/igmp.c 19 Nov 2003 07:11:46 -0000 1.21
@@ -2215,7 +2215,7 @@
seq_printf(seq,
"\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, jiffies_to_clock_t(im->timer.expires-jiffies), im->reporter);
}
return 0;
}
--
Hideaki YOSHIFUJI @ USAGI Project <yoshfuji@linux-ipv6.org>
GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2003-11-19 8:05 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-11-19 4:55 MLDv1 /proc/net/igmp6 timer printing [PATCH] David Stevens
2003-11-19 6:57 ` David S. Miller
-- strict thread matches above, loose matches on Subject: below --
2003-11-19 7:59 David Stevens
2003-11-19 8:05 ` YOSHIFUJI Hideaki / 吉藤英明
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).