From patchwork Tue Sep 23 07:03:48 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Borkmann X-Patchwork-Id: 392245 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id A240414009E for ; Tue, 23 Sep 2014 17:04:06 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754126AbaIWHEA (ORCPT ); Tue, 23 Sep 2014 03:04:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:32329 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753080AbaIWHD7 (ORCPT ); Tue, 23 Sep 2014 03:03:59 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s8N73soF013738 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 23 Sep 2014 03:03:55 -0400 Received: from localhost (vpn1-4-199.ams2.redhat.com [10.36.4.199]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s8N73rZk029055; Tue, 23 Sep 2014 03:03:54 -0400 From: Daniel Borkmann 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 Message-Id: <1411455828-5196-4-git-send-email-dborkman@redhat.com> In-Reply-To: <1411455828-5196-1-git-send-email-dborkman@redhat.com> References: <1411455828-5196-1-git-send-email-dborkman@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 Acked-by: Hannes Frederic Sowa --- 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; }