MPTCP Linux Development
 help / color / mirror / Atom feed
From: "Matthieu Baerts (NGI0)" <matttbe@kernel.org>
To: MPTCP Linux <mptcp@lists.linux.dev>
Cc: "Matthieu Baerts (NGI0)" <matttbe@kernel.org>
Subject: [PATCH iproute-mptcp 5/6] mptcp: monitor: add 'deny join id0' info
Date: Wed, 12 Nov 2025 17:24:48 +0100	[thread overview]
Message-ID: <20251112-laminar-v1-5-e23dbf584aa4@kernel.org> (raw)
In-Reply-To: <20251112-laminar-v1-0-e23dbf584aa4@kernel.org>

Until recently, the 'flags' attribute was not used. This has recently
been changed with the introduction of the 'deny_join_id0' flag [1].

This flag is set when a connection is created and the other peer set the
'C' flag in the MP_CAPABLE packets [2]. This flag can be set to tell the
other side that the peer will not accept extra subflows requests sent to
its initial IP address and port: typically set by a server behind a
legacy Layer 4 load balancer.

Now, when this flag is set, "deny_join_id0" will be printed instead of
"flags=1". Unknown remaining flags will be printed in hexadecimal at the
end, e.g. "flags=0x2".

Link: https://git.kernel.org/torvalds/c/2293c57484ae [1]
Link: https://datatracker.ietf.org/doc/html/rfc8684#section-3.1-20.6 [2]
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
 ip/ipmptcp.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/ip/ipmptcp.c b/ip/ipmptcp.c
index aaacc0a5..01f6906f 100644
--- a/ip/ipmptcp.c
+++ b/ip/ipmptcp.c
@@ -477,6 +477,7 @@ static int mptcp_monitor_msg(struct rtnl_ctrl_data *ctrl,
 	const struct genlmsghdr *ghdr = NLMSG_DATA(n);
 	struct rtattr *tb[MPTCP_ATTR_MAX + 1];
 	int len = n->nlmsg_len;
+	__u16 flags = 0;
 
 	len -= NLMSG_LENGTH(GENL_HDRLEN);
 	if (len < 0)
@@ -526,8 +527,6 @@ static int mptcp_monitor_msg(struct rtnl_ctrl_data *ctrl,
 		printf(" backup=%u", rta_getattr_u8(tb[MPTCP_ATTR_BACKUP]));
 	if (tb[MPTCP_ATTR_ERROR])
 		printf(" error=%u", rta_getattr_u8(tb[MPTCP_ATTR_ERROR]));
-	if (tb[MPTCP_ATTR_FLAGS])
-		printf(" flags=%x", rta_getattr_u16(tb[MPTCP_ATTR_FLAGS]));
 	if (tb[MPTCP_ATTR_TIMEOUT])
 		printf(" timeout=%u", rta_getattr_u32(tb[MPTCP_ATTR_TIMEOUT]));
 	if (tb[MPTCP_ATTR_IF_IDX])
@@ -539,6 +538,15 @@ static int mptcp_monitor_msg(struct rtnl_ctrl_data *ctrl,
 	if (tb[MPTCP_ATTR_SERVER_SIDE] && rta_getattr_u8(tb[MPTCP_ATTR_SERVER_SIDE]))
 		printf(" server_side");
 
+	if (tb[MPTCP_ATTR_FLAGS])
+		flags = rta_getattr_u16(tb[MPTCP_ATTR_FLAGS]);
+	if (flags & MPTCP_PM_EV_FLAG_DENY_JOIN_ID0) {
+		flags &= ~MPTCP_PM_EV_FLAG_DENY_JOIN_ID0;
+		printf(" deny_join_id0");
+	}
+	if (flags) /* remaining bits */
+		printf(" flags=0x%x", flags);
+
 	puts("");
 out:
 	fflush(stdout);

-- 
2.51.0


  parent reply	other threads:[~2025-11-12 16:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-12 16:24 [PATCH iproute-mptcp 0/6] mptcp: new endpoint type and info flags Matthieu Baerts (NGI0)
2025-11-12 16:24 ` [PATCH iproute-mptcp 1/6] MAINTAINERS: add entry for mptcp Matthieu Baerts (NGI0)
2025-11-12 16:24 ` [PATCH iproute-mptcp 2/6] man: mptcp: fix minor typos Matthieu Baerts (NGI0)
2025-11-12 16:24 ` [PATCH iproute-mptcp 3/6] mptcp: add 'laminar' endpoint support Matthieu Baerts (NGI0)
2025-11-17 16:48   ` Matthieu Baerts
2025-11-12 16:24 ` [PATCH iproute-mptcp 4/6] mptcp: monitor: add 'server side' info Matthieu Baerts (NGI0)
2025-11-12 16:24 ` Matthieu Baerts (NGI0) [this message]
2025-11-12 16:24 ` [PATCH iproute-mptcp 6/6] mptcp: monitor: support 'server side' as a flag Matthieu Baerts (NGI0)

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=20251112-laminar-v1-5-e23dbf584aa4@kernel.org \
    --to=matttbe@kernel.org \
    --cc=mptcp@lists.linux.dev \
    /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