Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp2458503imd; Fri, 2 Nov 2018 11:45:26 -0700 (PDT) X-Google-Smtp-Source: AJdET5c0T8Q3RdnJiEY2PGbtzciK3+rFdnZJfYDaTvQ8icZ3UZkhkcod4WKT6Dm3BMnnUJ/g9MOF X-Received: by 2002:a17:902:8d94:: with SMTP id v20-v6mr12951868plo.109.1541184326455; Fri, 02 Nov 2018 11:45:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541184326; cv=none; d=google.com; s=arc-20160816; b=LuovxPtjHi7V3x5vqFHYNU3naf1MbAbrjmTuAoMvmxlcydpZTfhV2HxhhHH8x92syF x4iP6zPwrxdwcEU39vJzwR5CDvX5wwigYu8fHDEsisenmR3MLvpoEe2Vi3VO8T1aWr/Z tnLsgxFraxXNu8qy/QUTbWFgLrTdz2L00VekchC9OIcP9ioIB7dSH6b/ggo9zmMyh2n7 KDGqwZpLD6IL9hXlhVvAYCyGWSnshtZH5xyX7fFs5yRuMDm9XyCAaPNL3gTRzxU5i9wW d7Hpvwy/pzblc5tTx/o0Awq5Rx4Z6f926G7L6ui5GDWZ32M/fdVTzBSuK/b+llRT/gpE JgcQ== 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=vHkb6r0wqOUG2f74HLeFzk2lLHGr1QDm1Vp/T7d0ZmI=; b=x9k/vPpKrtCGeq1PqasfI5KfQkwRoT2cjMBR9SITXttcAWAslyhy+z+Mft3HfyGOou XldEM8mWTXFu+GK9zgYkrdVK1ZQ5PbTzEVycqtExC2zxZr61lFdVCsAfW9b60oxm/ZuF gWn8jgA8hcrVrgOxFLfdl8Fvu2kMZFNRN7orjhmp0PIFT7AWdtxqjVoJDMRGVArZ75qs crvTPPs0ylduPf1TTB0o8tt60pQLorHOOh9jRZBvYDkBFsWHaaGnRn59qiQ6eqDQ1foD wXYCOZLwWYiIId3eviJpJjqmWAZufkgJT3l2uGZEStvm+FgOOKESiKSzHC7XAgmO4N1P W9ww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="L94H/HvM"; 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 b59-v6si36879399plb.206.2018.11.02.11.45.11; Fri, 02 Nov 2018 11:45:26 -0700 (PDT) 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="L94H/HvM"; 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 S1729909AbeKCDvM (ORCPT + 99 others); Fri, 2 Nov 2018 23:51:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:46434 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729437AbeKCDvL (ORCPT ); Fri, 2 Nov 2018 23:51:11 -0400 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (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 CB1242084A; Fri, 2 Nov 2018 18:42:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541184179; bh=0mwhO9z9uOzjTgobil2ZWsS9niOX3WuBmvfItPeEHjQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=L94H/HvMfzFkwm5WDVaS9Z5sfnkH41MT1KtfiuC6wqQvVWsBT46GR+mAabmvZPcZP 2fxP+Cv672fpehJrrcbl/mfNUhO2bvLpeYhSbXwQ6EMHKURC2w+Guj/tAojarnuLRL VQHP8Ig59JsCfbJ0gcXDuVY91kXjTgOsDG7+nqqU= 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.18 103/150] bridge: do not add port to router list when receives query with source 0.0.0.0 Date: Fri, 2 Nov 2018 19:34:25 +0100 Message-Id: <20181102182910.500575023@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181102182902.250560510@linuxfoundation.org> References: <20181102182902.250560510@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.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Hangbin Liu [ Upstream commit 5a2de63fd1a59c30c02526d427bc014b98adf508 ] 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 @@ -1420,7 +1420,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,