From: Abdul Wasey <w453y.me@gmail.com>
To: netdev@vger.kernel.org
Cc: razor@blackwall.org, idosch@nvidia.com, davem@davemloft.net,
edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com,
horms@kernel.org, horatiu.vultur@microchip.com,
bridge@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: [PATCH net-next v2 2/3] net: bridge: cfm: send an empty CFM nest when a bridge has no MEPs
Date: Mon, 5 Oct 2026 04:38:21 +0000 [thread overview]
Message-ID: <20261005043822.3106580-3-w453y.me@gmail.com> (raw)
In-Reply-To: <20261005043822.3106580-1-w453y.me@gmail.com>
br_fill_ifinfo() leaves IFLA_BRIDGE_CFM out when the bridge has no
MEPs. For a dump that is fine, but a notification sent after the last
MEP is deleted then looks like any other RTM_NEWLINK for the bridge,
and a listener can't tell that the CFM config is now empty.
Put an empty IFLA_BRIDGE_CFM nest in the message instead when CFM is
asked for and the bridge has no MEPs. Ports still get none, as before.
Signed-off-by: Abdul Wasey <w453y.me@gmail.com>
---
net/bridge/br_netlink.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c
index 5160e801d..68ec4529f 100644
--- a/net/bridge/br_netlink.c
+++ b/net/bridge/br_netlink.c
@@ -603,7 +603,10 @@ static int br_fill_ifinfo(struct sk_buff *skb,
struct nlattr *cfm_nest = NULL;
int err;
- if (!br_cfm_created(br) || port)
+ /* A bridge with no MEPs gets an empty IFLA_BRIDGE_CFM, so a
+ * listener can tell that the last MEP is gone.
+ */
+ if (!IS_ENABLED(CONFIG_BRIDGE_CFM) || port)
goto done;
cfm_nest = nla_nest_start(skb, IFLA_BRIDGE_CFM);
--
2.53.0
next prev parent reply other threads:[~2026-10-05 4:38 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-05 4:38 [PATCH net-next v2 0/3] net: bridge: cfm: notify userspace on CFM config changes Abdul Wasey
2026-10-05 4:38 ` [PATCH net-next v2 1/3] net: bridge: cfm: count CFM config attributes in the link message size Abdul Wasey
2026-10-05 4:38 ` Abdul Wasey [this message]
2026-10-05 4:38 ` [PATCH net-next v2 3/3] net: bridge: cfm: notify userspace on CFM config changes Abdul Wasey
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=20261005043822.3106580-3-w453y.me@gmail.com \
--to=w453y.me@gmail.com \
--cc=bridge@lists.linux.dev \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=horatiu.vultur@microchip.com \
--cc=horms@kernel.org \
--cc=idosch@nvidia.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=razor@blackwall.org \
/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
all inboxes | Powered by JetHome®