Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp2451153imd; Fri, 2 Nov 2018 11:37:10 -0700 (PDT) X-Google-Smtp-Source: AJdET5e+VoqleVrfn6cG49rC2k5Erd9ACUkt1/zay709ydpPqAXt3gPMSAfEr5uIlHiv9iohFp3c X-Received: by 2002:a63:a16:: with SMTP id 22mr11940382pgk.318.1541183830457; Fri, 02 Nov 2018 11:37:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541183830; cv=none; d=google.com; s=arc-20160816; b=gJJwd/rs1sjdA5SO9GDdh85fWG697fx40YhgqcxXkY+9emyB/PT7jWjjy2zi8SNdIZ 72o8uBYaVakOQgoSYYdEDWrigTwPvOrQ70dG0nAxTcUoozNummwg65OwMdDuIEKL7fL/ JOv4GSUViJvsEvpGXIQLc+JnPVK2DevZqjJ1v7lOMzK8XkvUPcmu8e95StCzMb1CGzqd NJ8HqslpNiEen3pDqsQ9pZIHHGQ0U7XoGtkw3IU9Z9RlpSOXl7NAZysdzqecyTZ1AQnC +EjcJQ42d0VpL6Y6EdlcglAQqMSMaBUVKsuEHdBoiT3ph6qEA/COb5eVbk4GhZ7PQODG 0hew== 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=17UPcWu1O6FhldZNHDSGd4tuA+TvPsEOv+rtR53PIvc=; b=f1EU2e2MM9glTrbV5GcGcMWcONc2RheD0KI6pApuhzU062dRQjOzvYqrUYMoER4PPa XCjVVndp9wZHzG9lGPV8oq7ukoBu9f2k1MOBoJlbwMuL0X8vOQBgtFNbkNc2r6jQvBza 2Q4GKUGxS2JRU7AWTdZbxGkzJRy1vvGGUp3X1gtA6HETDiGqBtmlljmVgvGljPjt7rQh I5CM02wI73DjjsJiHOX114RKaAkMPpxRU4SYbWojsFV9DYAMYkHT0nYk2Por7qKSFecN JsrRAB7sEdYld88cmz3MxBAQV3B2q5QcpD2375ZeMNS4QIC2lMAr5XtPXBy5YaqEGT0o Xgag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=q9bwa5Tc; 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 z126-v6si12978867pfb.280.2018.11.02.11.36.56; Fri, 02 Nov 2018 11:37:10 -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=q9bwa5Tc; 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 S1728270AbeKCDof (ORCPT + 99 others); Fri, 2 Nov 2018 23:44:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:38422 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727966AbeKCDof (ORCPT ); Fri, 2 Nov 2018 23:44:35 -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 D2B1A2081B; Fri, 2 Nov 2018 18:36:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541183784; bh=GQ2E3brYX7YhyKgCk+e0fV3svo5ZJmXG+NDzrcNwpCk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=q9bwa5TcRz6c1oyy/2W0RHFv7eg+araIwSrLLpFlGZTSPS+y+D99RxJS+YbwwFvoD Bmi59LbFGBUmxZL3MEKRP9GpF9UejYQ1rMFN/MOi8d2jSDox+jyc7uUpcHZDoyHtvM QpMlmtKc3WcINTPNR+MmWAfixIsnyhWsdHKHw5IQ= 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.19 01/24] bridge: do not add port to router list when receives query with source 0.0.0.0 Date: Fri, 2 Nov 2018 19:34:34 +0100 Message-Id: <20181102182839.913422845@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181102182839.725385066@linuxfoundation.org> References: <20181102182839.725385066@linuxfoundation.org> User-Agent: quilt/0.65 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.19-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 void br_ip4_multicast_query(struct net_bridge *br,