Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2029598pxj; Sun, 9 May 2021 12:47:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxOWd7KMcwPULbx5bGlNvboVrqTMHYO7huXEWZChHBk/xNdzQPBhfxw+Qz8uA4xEDMItqvd X-Received: by 2002:a17:906:6801:: with SMTP id k1mr21768784ejr.137.1620589629055; Sun, 09 May 2021 12:47:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620589629; cv=none; d=google.com; s=arc-20160816; b=O/Xhdl+rAcHDya0gsU4cd+8XG/bAalKrb1q+VfbwLfSRvCqn0e86KapdGbcLOk2JpM Pm/iDm1faHvzJ+AkETtXbetenv9Fb1J6ZJ018iUuzshh42dMsJq4n4sVGALFYVpJhlZ2 amtLelK53HyZpGCUybqnKIoSJW8m3ckYrZDILY/NefMgn/3bdS1f4ZrnLIOL0iiComcT ofFc9yczrAwWfQFU9jzf6q4Wjqg5Y22R1az8a7A5w7X0n4HJZzFQ8gncXmgUjGB0aCkq oshNeCQEq9GPXJx/ETBXGsrQrKaZyshjQ7zIIqkbwQIQlTIos+kXaAR3pAWxnPEW/5GK LU2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=I7S4ItrNpISTGDjzKet6Swazz9Xsupr1Miu5Iq6uEh4=; b=d/X8ak83YDH2AbY2cCJdvGfnu6yD8TYUo/dSb+VQG2c76uMCwmzbTixtzeAM3onb3n eWLvG68Sm5ozypmq1oV4LBWBCewpOk5bDVu9mKOZaSranOk+zGA3qR/BbSPM977Tgh4u OFFKsFMzjhV0FyUgS7N76jyqFKRZ0Axlmqj9A+8M58B73cESx57vZqPX4ui2j4EPF3r2 mp5CmBhn+2BNSxMME53BSVM04PQK0o23iXNPlWSJ5UZiGaP5InOb8Mik3WUDbYz5ys4M +Q31NtzegtfzXeZwMAN5ynFBwoWlmAeMq3OxKDkqxRDjTxFCeUEmI7aNAVQZeurNyqa0 0Rxw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hq10si5793154ejc.165.2021.05.09.12.46.45; Sun, 09 May 2021 12:47:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230116AbhEITqo (ORCPT + 99 others); Sun, 9 May 2021 15:46:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229952AbhEITqa (ORCPT ); Sun, 9 May 2021 15:46:30 -0400 Received: from mail.aperture-lab.de (mail.aperture-lab.de [IPv6:2a01:4f8:c2c:665b::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E4C38C061573; Sun, 9 May 2021 12:45:26 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 3CE4A3EDDF; Sun, 9 May 2021 21:45:25 +0200 (CEST) From: =?UTF-8?q?Linus=20L=C3=BCssing?= To: netdev@vger.kernel.org Cc: Roopa Prabhu , Nikolay Aleksandrov , Jakub Kicinski , "David S . Miller" , bridge@lists.linux-foundation.org, b.a.t.m.a.n@lists.open-mesh.org, linux-kernel@vger.kernel.org, =?UTF-8?q?Linus=20L=C3=BCssing?= Subject: [net-next v2 04/11] net: bridge: mcast: prepare query reception for mcast router split Date: Sun, 9 May 2021 21:45:02 +0200 Message-Id: <20210509194509.10849-5-linus.luessing@c0d3.blue> In-Reply-To: <20210509194509.10849-1-linus.luessing@c0d3.blue> References: <20210509194509.10849-1-linus.luessing@c0d3.blue> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Last-TLS-Session-Version: TLSv1.2 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In preparation for the upcoming split of multicast router state into their IPv4 and IPv6 variants and as the br_multicast_mark_router() will be split for that remove the select querier wrapper and instead add ip4 and ip6 variants for br_multicast_query_received(). Signed-off-by: Linus Lüssing --- net/bridge/br_multicast.c | 53 ++++++++++++++++++++------------------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c index 6fe93a3..7edbbc9 100644 --- a/net/bridge/br_multicast.c +++ b/net/bridge/br_multicast.c @@ -2615,22 +2615,6 @@ update: } #endif -static bool br_multicast_select_querier(struct net_bridge *br, - struct net_bridge_port *port, - struct br_ip *saddr) -{ - switch (saddr->proto) { - case htons(ETH_P_IP): - return br_ip4_multicast_select_querier(br, port, saddr->src.ip4); -#if IS_ENABLED(CONFIG_IPV6) - case htons(ETH_P_IPV6): - return br_ip6_multicast_select_querier(br, port, &saddr->src.ip6); -#endif - } - - return false; -} - static void br_multicast_update_query_timer(struct net_bridge *br, struct bridge_mcast_other_query *query, @@ -2708,19 +2692,36 @@ static void br_multicast_mark_router(struct net_bridge *br, now + br->multicast_querier_interval); } -static void br_multicast_query_received(struct net_bridge *br, - struct net_bridge_port *port, - struct bridge_mcast_other_query *query, - struct br_ip *saddr, - unsigned long max_delay) +static void +br_ip4_multicast_query_received(struct net_bridge *br, + struct net_bridge_port *port, + struct bridge_mcast_other_query *query, + struct br_ip *saddr, + unsigned long max_delay) { - if (!br_multicast_select_querier(br, port, saddr)) + if (!br_ip4_multicast_select_querier(br, port, saddr->src.ip4)) return; br_multicast_update_query_timer(br, query, max_delay); br_multicast_mark_router(br, port); } +#if IS_ENABLED(CONFIG_IPV6) +static void +br_ip6_multicast_query_received(struct net_bridge *br, + struct net_bridge_port *port, + struct bridge_mcast_other_query *query, + struct br_ip *saddr, + unsigned long max_delay) +{ + if (!br_ip6_multicast_select_querier(br, port, &saddr->src.ip6)) + return; + + br_multicast_update_query_timer(br, query, max_delay); + br_multicast_mark_router(br, port); +} +#endif + static void br_ip4_multicast_query(struct net_bridge *br, struct net_bridge_port *port, struct sk_buff *skb, @@ -2768,8 +2769,8 @@ static void br_ip4_multicast_query(struct net_bridge *br, saddr.proto = htons(ETH_P_IP); saddr.src.ip4 = iph->saddr; - br_multicast_query_received(br, port, &br->ip4_other_query, - &saddr, max_delay); + br_ip4_multicast_query_received(br, port, &br->ip4_other_query, + &saddr, max_delay); goto out; } @@ -2856,8 +2857,8 @@ static int br_ip6_multicast_query(struct net_bridge *br, saddr.proto = htons(ETH_P_IPV6); saddr.src.ip6 = ipv6_hdr(skb)->saddr; - br_multicast_query_received(br, port, &br->ip6_other_query, - &saddr, max_delay); + br_ip6_multicast_query_received(br, port, &br->ip6_other_query, + &saddr, max_delay); goto out; } else if (!group) { goto out; -- 2.31.0