Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp615723pxj; Thu, 13 May 2021 12:38:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz33DRTDS5aYoIn1t4c+bAMnJMlUUx1eWqFeg/3uaaRbNxtaLEY8k4KXlLY5RRYMEsaGqjh X-Received: by 2002:aa7:d90d:: with SMTP id a13mr50823977edr.76.1620934733917; Thu, 13 May 2021 12:38:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620934733; cv=none; d=google.com; s=arc-20160816; b=aKBnOyZFeGQ8iGYsv2orI0VnmvIaAoiOvBiHotcWDJ5PbotkABlYuYRicrgv+SeCOW oN5hckzHR6U+3ntVVtAtU6ZOxopOW6x9eWO4VXCvXhLksBhEX8ZTrAKh+jYyHt/3bXre 8CbpFVXdF9tZuQHdNvrisLMNTOYAuNfOtDpLVmJs7tT0vcPyxuIRhqeP4rVgOmN50WLQ +uqYr0pl8OKES1roli+CliXzOdlqc6ciacMVeXbvMrVv9mPJFKzaFwj9QgOz7UskMKkK 0nxztjnSEexSNK34qoipeLZ7u6oJQrTl+1xTI1fkrVQBr7fcP9EeYdq8zWQftRfT8icm /urw== 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=usVdrFTZDNBdD9gcFhCurbQm/PcgZi6uQxCqqSsOEHGA1C/ULZEg0Kv/sdEX6PhSb1 q349vPqMmVKBw2lF+OE1TR69e9t/Mu36TrpxhLg54B7+tSYlGpkoAq+IwJOxmNadgTJR BkSqt/PA8L383T73rp5wuBlJmp4VlJcCskPIO5BhTFFG94oMRZoJ8kk8jDWNp4jNBCYC FYONeyC3LEnnbx4TF+lsKiJ+3iNMz9mjuQa4OK8lo5oNACR/XAhmqRRdd6V8qdhd0pJf QnROrBD9iRRQwcJOcE4oQ5fuxwbtbfxRaUCpBE4IdWxStADrRL18+3cgUFIY9AmFgukc e1cA== 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 hq17si3589764ejc.641.2021.05.13.12.38.29; Thu, 13 May 2021 12:38:53 -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 S234285AbhEMNXm (ORCPT + 99 others); Thu, 13 May 2021 09:23:42 -0400 Received: from mail.aperture-lab.de ([116.203.183.178]:53030 "EHLO mail.aperture-lab.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234003AbhEMNWc (ORCPT ); Thu, 13 May 2021 09:22:32 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 7647D4100D; Thu, 13 May 2021 15:21:08 +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 v4 10/11] net: bridge: mcast: add ip4+ip6 mcast router timers to mdb netlink Date: Thu, 13 May 2021 15:20:52 +0200 Message-Id: <20210513132053.23445-11-linus.luessing@c0d3.blue> In-Reply-To: <20210513132053.23445-1-linus.luessing@c0d3.blue> References: <20210513132053.23445-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