Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mptcp: pm: netlink: announce server-side flag

Now that the 'flags' attribute is used, it seems interesting to add one
flag for 'server-side', a boolean value.

This is duplicating the info from the dedicated 'server-side' attribute,
but it will be deprecated in the next commit, and removed in a few
versions.

Reviewed-by: Geliang Tang <geliang@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Link: https://patch.msgid.link/20250919-net-next-mptcp-server-side-flag-v1-2-a97a5d561a8b@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Matthieu Baerts (NGI0) and committed by
Jakub Kicinski
3d7ae911 c9809f03

+8 -4
+1
include/uapi/linux/mptcp.h
··· 32 32 #define MPTCP_INFO_FLAG_REMOTE_KEY_RECEIVED _BITUL(1) 33 33 34 34 #define MPTCP_PM_EV_FLAG_DENY_JOIN_ID0 _BITUL(0) 35 + #define MPTCP_PM_EV_FLAG_SERVER_SIDE _BITUL(1) 35 36 36 37 #define MPTCP_PM_ADDR_FLAG_SIGNAL (1 << 0) 37 38 #define MPTCP_PM_ADDR_FLAG_SUBFLOW (1 << 1)
+7 -4
net/mptcp/pm_netlink.c
··· 413 413 if (err) 414 414 return err; 415 415 416 - /* only set when it is the server side */ 417 - if (READ_ONCE(msk->pm.server_side) && 418 - nla_put_u8(skb, MPTCP_ATTR_SERVER_SIDE, 1)) 419 - return -EMSGSIZE; 416 + if (READ_ONCE(msk->pm.server_side)) { 417 + flags |= MPTCP_PM_EV_FLAG_SERVER_SIDE; 418 + 419 + /* only set when it is the server side */ 420 + if (nla_put_u8(skb, MPTCP_ATTR_SERVER_SIDE, 1)) 421 + return -EMSGSIZE; 422 + } 420 423 421 424 if (READ_ONCE(msk->pm.remote_deny_join_id0)) 422 425 flags |= MPTCP_PM_EV_FLAG_DENY_JOIN_ID0;