Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp47186imu; Thu, 8 Nov 2018 14:31:29 -0800 (PST) X-Google-Smtp-Source: AJdET5fpuV+DOWSuC6ywgXptrRMyrNrp4IOiktP67O/6sU2VThtLlZZQrgdQ9r1zWbjd9SgU4Yjk X-Received: by 2002:a63:484c:: with SMTP id x12mr5268220pgk.375.1541716289229; Thu, 08 Nov 2018 14:31:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541716289; cv=none; d=google.com; s=arc-20160816; b=khNmnRxhkRAqOJWok1jI2f2PtyxVKlgrZyFK+luxR7RMc6a3h99Jysm6lM/s02fkJd FqpXMxEeSALfVvzMhGVymSrt7NNTEBO4lGlwOXesGFAPAhMKeWK1S4vu6AhAgv+Lainj PJ6klR9XL6ILC5H39At05BxPgnqE2UOkeHVtu7oNRFSXrz8B/kxNJ36/pnHMgrusW8oj ehMiVAfyi+nziHSTq0bpsf7nz/3cs6Fs8w5m5HZCPl6/+C6TZKESsfS/HZt2q7r4P6qs npiV8h+G+kf4jwbo16axotNifzwS2yDVBDrcWhu9YrO2mX2aRFQqxJRX81cFw1/DkP+8 CDhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=6x3y/OOpBh+szjYluvPjsE5j/virYuKKpx0tTd7Zfkw=; b=YSXzj/Tod+SiMM9S0LIS+nrAOo3teMJ/bi9ozqzVvZxiEfCwAqnX0s19V0JX3fe55v jQidTLLARUVoERPENlOORsrRhfK8cEK5qqnu4gmheZbKD7mWZCsEJhMCcGC0e+RdpvES iyZ9l8w5onWbnctEnoSIwpFof1ejUqA+p65qbmdx2D7JmrzPISsLYIST9Rh9SQr21SJP cC5kUUdQRjqfKDkIz4N7e342PJNlMvg5KS/v5Lv9S72ml3F6eYZpkDpb/VRWcKWYMuHR 7hvn8RG/1r4rH4iyeO7fZjJxp84uNenozmHTcNOWfdvRMfmjutdC/hKyRqHLBwE5X3q6 zDUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=pdSSQnZh; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c12-v6si5384721pfo.189.2018.11.08.14.31.12; Thu, 08 Nov 2018 14:31:29 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=pdSSQnZh; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728833AbeKIII0 (ORCPT + 99 others); Fri, 9 Nov 2018 03:08:26 -0500 Received: from mail.kernel.org ([198.145.29.99]:56822 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729663AbeKIHiA (ORCPT ); Fri, 9 Nov 2018 02:38:00 -0500 Received: from localhost (unknown [208.72.13.198]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 96D5620892; Thu, 8 Nov 2018 22:00:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541714431; bh=rOMhF/30MKBShKU1mtUXN1p6JC+D7ta+9sH7LD5T0ns=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pdSSQnZhffOGjpVexo0EWTuFuIazIFytt9+usiw7eRCTaX547C6x7orpscyuBPwX1 p5YOMENIozuFqKN1v3BAu3JDLongSROKOsCYWOSY3I8H0hX/ablRzzRHTKFWFnd2Jn j8MAKnPPAEZXYSHnWutJA0jyd9/JHVqge0Phd5KI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ying Xu , Hangbin Liu , Nikolay Aleksandrov , Roopa Prabhu , "David S. Miller" Subject: [PATCH 4.4 088/114] bridge: do not add port to router list when receives query with source 0.0.0.0 Date: Thu, 8 Nov 2018 13:51:43 -0800 Message-Id: <20181108215108.815292660@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181108215059.051093652@linuxfoundation.org> References: <20181108215059.051093652@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Hangbin Liu commit 5a2de63fd1a59c30c02526d427bc014b98adf508 upstream. Based on RFC 4541, 2.1.1. IGMP Forwarding Rules The switch supporting IGMP snooping must maintain a list of multicast routers and the ports on which they are attached. This list can be constructed in any combination of the following ways: a) This list should be built by the snooping switch sending Multicast Router Solicitation messages as described in IGMP Multicast Router Discovery [MRDISC]. It may also snoop Multicast Router Advertisement messages sent by and to other nodes. b) The arrival port for IGMP Queries (sent by multicast routers) where the source address is not 0.0.0.0. We should not add the port to router list when receives query with source 0.0.0.0. Reported-by: Ying Xu Signed-off-by: Hangbin Liu Acked-by: Nikolay Aleksandrov Acked-by: Roopa Prabhu Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/bridge/br_multicast.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) --- a/net/bridge/br_multicast.c +++ b/net/bridge/br_multicast.c @@ -1261,7 +1261,15 @@ static void br_multicast_query_received( return; br_multicast_update_query_timer(br, query, max_delay); - br_multicast_mark_router(br, port); + + /* Based on RFC4541, section 2.1.1 IGMP Forwarding Rules, + * the arrival port for IGMP Queries where the source address + * is 0.0.0.0 should not be added to router port list. + */ + if ((saddr->proto == htons(ETH_P_IP) && saddr->u.ip4) || + (saddr->proto == htons(ETH_P_IPV6) && + !ipv6_addr_any(&saddr->u.ip6))) + br_multicast_mark_router(br, port); } static int br_ip4_multicast_query(struct net_bridge *br,