Netdev List
 help / color / mirror / Atom feed
From: "Linus Lüssing" <linus.luessing@c0d3.blue>
To: netdev@vger.kernel.org
Cc: "Roopa Prabhu" <roopa@nvidia.com>,
	"Nikolay Aleksandrov" <nikolay@nvidia.com>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"David S . Miller" <davem@davemloft.net>,
	bridge@lists.linux-foundation.org, linux-kernel@vger.kernel.org,
	"Linus Lüssing" <linus.luessing@c0d3.blue>
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	[thread overview]
Message-ID: <20210512231941.19211-11-linus.luessing@c0d3.blue> (raw)
In-Reply-To: <20210512231941.19211-1-linus.luessing@c0d3.blue>

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 <linus.luessing@c0d3.blue>
---
 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


  parent reply	other threads:[~2021-05-12 23:28 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-12 23:19 [PATCH net-next v3 00/11] net: bridge: split IPv4/v6 mc router state and export for batman-adv Linus Lüssing
2021-05-12 23:19 ` [net-next v3 01/11] net: bridge: mcast: rename multicast router lists and timers Linus Lüssing
2021-05-13 11:29   ` Nikolay Aleksandrov
2021-05-12 23:19 ` [net-next v3 02/11] net: bridge: mcast: add wrappers for router node retrieval Linus Lüssing
2021-05-13 11:29   ` Nikolay Aleksandrov
2021-05-12 23:19 ` [net-next v3 03/11] net: bridge: mcast: prepare mdb netlink for mcast router split Linus Lüssing
2021-05-13 11:30   ` Nikolay Aleksandrov
2021-05-12 23:19 ` [net-next v3 04/11] net: bridge: mcast: prepare query reception " Linus Lüssing
2021-05-13 11:30   ` Nikolay Aleksandrov
2021-05-12 23:19 ` [net-next v3 05/11] net: bridge: mcast: prepare is-router function " Linus Lüssing
2021-05-13 11:32   ` Nikolay Aleksandrov
2021-05-12 23:19 ` [net-next v3 06/11] net: bridge: mcast: prepare expiry functions " Linus Lüssing
2021-05-13 11:33   ` Nikolay Aleksandrov
2021-05-12 23:19 ` [net-next v3 07/11] net: bridge: mcast: prepare add-router function " Linus Lüssing
2021-05-13 11:35   ` Nikolay Aleksandrov
2021-05-12 23:19 ` [net-next v3 08/11] net: bridge: mcast: split router port del+notify " Linus Lüssing
2021-05-13 11:46   ` Nikolay Aleksandrov
2021-05-12 23:19 ` [net-next v3 09/11] net: bridge: mcast: split multicast router state for IPv4 and IPv6 Linus Lüssing
2021-05-13 11:59   ` Nikolay Aleksandrov
2021-05-12 23:19 ` Linus Lüssing [this message]
2021-05-13 11:38   ` [net-next v3 10/11] net: bridge: mcast: add ip4+ip6 mcast router timers to mdb netlink Nikolay Aleksandrov
2021-05-12 23:19 ` [net-next v3 11/11] net: bridge: mcast: export multicast router presence adjacent to a port Linus Lüssing
2021-05-13 11:39   ` Nikolay Aleksandrov
2021-05-13 12:02 ` [PATCH net-next v3 00/11] net: bridge: split IPv4/v6 mc router state and export for batman-adv Nikolay Aleksandrov
2021-05-13 13:34   ` Linus Lüssing
2021-05-13 13:36     ` Nikolay Aleksandrov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210512231941.19211-11-linus.luessing@c0d3.blue \
    --to=linus.luessing@c0d3.blue \
    --cc=bridge@lists.linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nikolay@nvidia.com \
    --cc=roopa@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox