Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2030239pxj; Sun, 9 May 2021 12:48:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJziNx2fsC6HeFW0DWmOF6tEl3GJhNXGLhoC8Sn1V5X1uk3qpdtPpBCa+jBhpWF/NwM6E3xj X-Received: by 2002:a05:6402:100c:: with SMTP id c12mr8197949edu.165.1620589727850; Sun, 09 May 2021 12:48:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620589727; cv=none; d=google.com; s=arc-20160816; b=FR5iXz7o9oYJKlN3uL2QrfPgTRVgnI/K54Gk8GF8fIci++0KaXRH//CmTMyapN7veZ p7/zqNnV6Nlcu1+FjY85pBarCt0aHNVNIYi/XRdErEMvtN5XRs550nNcIlIJU9YkTC+b YZxXqRnrSGaVb6OynOkRGuq8/5ATfiztNC0sltE+1yllK56SiVsQ5KzwBdpClc06FfTC RRJfjl0fv5Oyc4PVtZBwtAHxXJHoe0vGLdmeC9b5pYXtzgmVw9Pbtm0Z3fpTV96ovilt 3mjXZhfm1XZYzrrvYaL/mqHCNv9Tw+e8swg7a/MPpAjzqgdvBehM2CIHTfZ5unLUis60 r5Qg== 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=QbZKj4qo//i72h9OX7LZ12dKLTmP3WU2PQmFP9nGfxw=; b=R7UfjSEOvMbnB6gto40rii+V6Ozq7kZu8yJoNaaG7i5DofjXHD6klAhEZ7sgw69VUw mW4S3tZOJHz6o6DhIxWkd5jhedo0KIl28IUKtEwgLp9RNibtN9Fu/YS+eVfGr3mQiqYN zxGSTr1wQnGtx2KTdARXmSdRPSObTLefO1wAFMEAdbsmc6XKeW3qVNyKAJm2iej52gTv CNbIit7VxvUKLrkBtVK2cWXnmnoTb8izqR0Zbun7qdtwehZlkUeEAvwRTwgOlNvwQadj 1ZgJbB6hL7vfsPIiyNtzguUwoCs6HgZ6SqBjXb6AZRaK2IMwsdshzTQA6Z3IFulFf2g4 QEOQ== 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 a15si12982857edr.562.2021.05.09.12.48.24; Sun, 09 May 2021 12:48:47 -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 S230299AbhEITrD (ORCPT + 99 others); Sun, 9 May 2021 15:47:03 -0400 Received: from mail.aperture-lab.de ([116.203.183.178]:56172 "EHLO mail.aperture-lab.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230018AbhEITqh (ORCPT ); Sun, 9 May 2021 15:46:37 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 6413D3EDDF; Sun, 9 May 2021 21:45:31 +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 10/11] net: bridge: mcast: add ip4+ip6 mcast router timers to mdb netlink Date: Sun, 9 May 2021 21:45:08 +0200 Message-Id: <20210509194509.10849-11-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 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 3c608da..2cdd9b6 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