netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] net: bridge: convert MLDv2 Query MRC into msecs_to_jiffies for max_delay
@ 2013-08-29 21:55 Daniel Borkmann
  2013-08-30 21:57 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel Borkmann @ 2013-08-29 21:55 UTC (permalink / raw)
  To: davem; +Cc: netdev, Linus Lüssing, Hannes Frederic Sowa

While looking into MLDv1/v2 code, I noticed that bridging code does
not convert it's max delay into jiffies for MLDv2 messages as we do
in core IPv6' multicast code.

RFC3810, 5.1.3. Maximum Response Code says:

  The Maximum Response Code field specifies the maximum time allowed
  before sending a responding Report. The actual time allowed, called
  the Maximum Response Delay, is represented in units of milliseconds,
  and is derived from the Maximum Response Code as follows: [...]

As we update timers that work with jiffies, we need to convert it.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Cc: Linus Lüssing <linus.luessing@web.de>
Cc: Hannes Frederic Sowa <hannes@stressinduktion.org>
---
 net/bridge/br_multicast.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c
index 08e576a..08d2921 100644
--- a/net/bridge/br_multicast.c
+++ b/net/bridge/br_multicast.c
@@ -1203,7 +1203,8 @@ static int br_ip6_multicast_query(struct net_bridge *br,
 		mld2q = (struct mld2_query *)icmp6_hdr(skb);
 		if (!mld2q->mld2q_nsrcs)
 			group = &mld2q->mld2q_mca;
-		max_delay = mld2q->mld2q_mrc ? MLDV2_MRC(ntohs(mld2q->mld2q_mrc)) : 1;
+
+		max_delay = max(msecs_to_jiffies(MLDV2_MRC(ntohs(mld2q->mld2q_mrc))), 1UL);
 	}
 
 	br_multicast_query_received(br, port, !ipv6_addr_any(&ip6h->saddr),
-- 
1.7.11.7

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

* Re: [PATCH net] net: bridge: convert MLDv2 Query MRC into msecs_to_jiffies for max_delay
  2013-08-29 21:55 [PATCH net] net: bridge: convert MLDv2 Query MRC into msecs_to_jiffies for max_delay Daniel Borkmann
@ 2013-08-30 21:57 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2013-08-30 21:57 UTC (permalink / raw)
  To: dborkman; +Cc: netdev, linus.luessing, hannes

From: Daniel Borkmann <dborkman@redhat.com>
Date: Thu, 29 Aug 2013 23:55:05 +0200

> While looking into MLDv1/v2 code, I noticed that bridging code does
> not convert it's max delay into jiffies for MLDv2 messages as we do
> in core IPv6' multicast code.
> 
> RFC3810, 5.1.3. Maximum Response Code says:
> 
>   The Maximum Response Code field specifies the maximum time allowed
>   before sending a responding Report. The actual time allowed, called
>   the Maximum Response Delay, is represented in units of milliseconds,
>   and is derived from the Maximum Response Code as follows: [...]
> 
> As we update timers that work with jiffies, we need to convert it.
> 
> Signed-off-by: Daniel Borkmann <dborkman@redhat.com>

Applied and queued up for -stable, thanks.

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

end of thread, other threads:[~2013-08-30 21:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-29 21:55 [PATCH net] net: bridge: convert MLDv2 Query MRC into msecs_to_jiffies for max_delay Daniel Borkmann
2013-08-30 21:57 ` David 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).