From: Daniel Borkmann <dborkman@redhat.com>
To: davem@davemloft.net
Cc: hannes@stressinduktion.org, netdev@vger.kernel.org
Subject: [PATCH net-next 3/3] ipv6: mld: remove duplicate code from mld_update_qri
Date: Tue, 23 Sep 2014 09:03:48 +0200 [thread overview]
Message-ID: <1411455828-5196-4-git-send-email-dborkman@redhat.com> (raw)
In-Reply-To: <1411455828-5196-1-git-send-email-dborkman@redhat.com>
The QRI (Query Response Interval) from RFC3810, section 9.3. is the same
as we calculate anyway earlier. Therefore, we can just remove that code
and simply reuse the value of max_delay.
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
---
net/ipv6/mcast.c | 17 ++++++-----------
1 file changed, 6 insertions(+), 11 deletions(-)
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
index 2a4d2b1..e4139e5 100644
--- a/net/ipv6/mcast.c
+++ b/net/ipv6/mcast.c
@@ -1226,16 +1226,6 @@ static void mld_update_qi(struct inet6_dev *idev,
idev->mc_qi = mc_qqi * HZ;
}
-static void mld_update_qri(struct inet6_dev *idev,
- const struct mld2_query *mlh2)
-{
- /* RFC3810, relevant sections:
- * - 5.1.3. Maximum Response Code
- * - 9.3. Query Response Interval
- */
- idev->mc_qri = msecs_to_jiffies(mldv2_mrc(mlh2));
-}
-
static int mld_process_v1(struct inet6_dev *idev, struct mld_msg *mld,
unsigned long *max_delay)
{
@@ -1272,7 +1262,12 @@ static int mld_process_v2(struct inet6_dev *idev, struct mld2_query *mld,
mld_update_qrv(idev, mld);
mld_update_qi(idev, mld);
- mld_update_qri(idev, mld);
+
+ /* RFC3810, relevant sections:
+ * - 5.1.3. Maximum Response Code
+ * - 9.3. Query Response Interval
+ */
+ idev->mc_qri = *max_delay;
return 0;
}
--
1.7.11.7
next prev parent reply other threads:[~2014-09-23 7:03 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-23 7:03 [PATCH net-next 0/3] mld updates, part 2 Daniel Borkmann
2014-09-23 7:03 ` [PATCH net-next 1/3] ipv6: mld: rename mc_maxdelay into mc_uri Daniel Borkmann
2014-09-24 20:34 ` Hannes Frederic Sowa
2014-09-23 7:03 ` [PATCH net-next 2/3] ipv6: mld: do not overwrite uri when receiving an mldv2 query Daniel Borkmann
2014-09-24 20:36 ` Hannes Frederic Sowa
2014-09-25 16:02 ` David L Stevens
2014-09-25 20:06 ` Daniel Borkmann
2014-09-25 23:23 ` David L Stevens
2014-09-26 9:29 ` Daniel Borkmann
2014-09-26 12:13 ` David L Stevens
2014-09-26 12:23 ` Daniel Borkmann
2014-09-25 23:29 ` David L Stevens
2014-09-23 7:03 ` Daniel Borkmann [this message]
2014-09-24 20:36 ` [PATCH net-next 3/3] ipv6: mld: remove duplicate code from mld_update_qri Hannes Frederic Sowa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1411455828-5196-4-git-send-email-dborkman@redhat.com \
--to=dborkman@redhat.com \
--cc=davem@davemloft.net \
--cc=hannes@stressinduktion.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).