Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4925038pxj; Wed, 12 May 2021 16:44:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxHppROzXxmGqSoihpH4aaXkoY0ZBPxfTT9eqkKaKfAu5PxyYBS7w0LZQBJ3NgT+IJrSW5+ X-Received: by 2002:a05:6808:117:: with SMTP id b23mr27855743oie.7.1620863068341; Wed, 12 May 2021 16:44:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620863068; cv=none; d=google.com; s=arc-20160816; b=UPASLV3fes0hLF4r3mIFQDTiwrbRNjKD2SNmtJzNjvSXQytO9qLakJr74bY7d7TmY8 4w9oJudRvCzKk91lkFtqNvOgn8wq4wcUH9JqmMb5eNF9tApBRWocLRTBd9bban6IYYK3 o8bciJck4+oOPy8VkhXKa+j9GWa1yJpJYjRzRe+V4iGx8IiY9828zt3SXP+jQtdFkHys tzZFF6zgek+OTTtZhKahkKjW72lAvLgp4dD+ItBBwi1Si3TEi0C9hn0aPv3siOudR84f nptH1I1EOL/J+H8L5jdRz/YemKLP1SBpCbnDAu5igHZ1JPSZ/k2CSBhBeLrsrRSTRAiR TViw== 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=E3qVKO3TKC7tEmYNsABQrUdMO7GMTuUUaDnakKDjlxM=; b=OGnsbVqg0PEOTbhsEgQmFwKn0Auk7ehvqkqj9CRkNNY6AdT+xBrYoAXZuc3tHIkD/V Nco0/TV5l9KSIbsynh6Umx9Lt/0dNfud0AgmDAT9n2UcK7nupj6A2/I+vUABk0IfjbmK pZOuE9G5UgfWH7DFQ8xyPTUvZ1VhXtVujmHfrI8TvuAHJksG9l4KjrBZW4M7iZwYrSSw INEIrhnvyCEJgZhq9VQfv1WN9H01FwARqAOQgl6Q7rToYVCeusYopElJdgVkZEIXWBy4 Lt62qdc3cUs6TEci3hDabY0ds1PPuYeCy3SkAw+FtiQgLPKDnoNqHmXqu4dZ+LA1kV78 Dicg== 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 n193si1393473oig.270.2021.05.12.16.44.14; Wed, 12 May 2021 16:44:28 -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 S237135AbhELXki (ORCPT + 99 others); Wed, 12 May 2021 19:40:38 -0400 Received: from mail.aperture-lab.de ([116.203.183.178]:50958 "EHLO mail.aperture-lab.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234105AbhELXVK (ORCPT ); Wed, 12 May 2021 19:21:10 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id C51404100F; Thu, 13 May 2021 01:19:56 +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, linux-kernel@vger.kernel.org, =?UTF-8?q?Linus=20L=C3=BCssing?= Subject: [net-next v3 10/11] net: bridge: mcast: add ip4+ip6 mcast router timers to mdb netlink Date: Thu, 13 May 2021 01:19:40 +0200 Message-Id: <20210512231941.19211-11-linus.luessing@c0d3.blue> In-Reply-To: <20210512231941.19211-1-linus.luessing@c0d3.blue> References: <20210512231941.19211-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 Now that we have split the multicast router state into two, one for IPv4 and one for IPv6, also add individual timers to the mdb netlink router port dump. Leaving the old timer attribute for backwards compatibility. Signed-off-by: Linus Lüssing --- include/uapi/linux/if_bridge.h | 2 ++ net/bridge/br_mdb.c | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/include/uapi/linux/if_bridge.h b/include/uapi/linux/if_bridge.h index 13d59c5..6b56a75 100644 --- a/include/uapi/linux/if_bridge.h +++ b/include/uapi/linux/if_bridge.h @@ -627,6 +627,8 @@ enum { MDBA_ROUTER_PATTR_UNSPEC, MDBA_ROUTER_PATTR_TIMER, MDBA_ROUTER_PATTR_TYPE, + MDBA_ROUTER_PATTR_INET_TIMER, + MDBA_ROUTER_PATTR_INET6_TIMER, __MDBA_ROUTER_PATTR_MAX }; #define MDBA_ROUTER_PATTR_MAX (__MDBA_ROUTER_PATTR_MAX - 1) diff --git a/net/bridge/br_mdb.c b/net/bridge/br_mdb.c index 10c416c..3f839a8 100644 --- a/net/bridge/br_mdb.c +++ b/net/bridge/br_mdb.c @@ -79,7 +79,13 @@ static int br_rports_fill_info(struct sk_buff *skb, struct netlink_callback *cb, nla_put_u32(skb, MDBA_ROUTER_PATTR_TIMER, max(ip4_timer, ip6_timer)) || nla_put_u8(skb, MDBA_ROUTER_PATTR_TYPE, - p->multicast_router)) { + p->multicast_router) || + (have_ip4_mc_rtr && + nla_put_u32(skb, MDBA_ROUTER_PATTR_INET_TIMER, + ip4_timer)) || + (have_ip6_mc_rtr && + nla_put_u32(skb, MDBA_ROUTER_PATTR_INET6_TIMER, + ip6_timer))) { nla_nest_cancel(skb, port_nest); goto fail; } -- 2.31.0