aboutsummaryrefslogtreecommitdiffstats
path: root/net/mptcp
diff options
context:
space:
mode:
authorMatthieu Baerts (NGI0) <matttbe@kernel.org>2025-09-19 14:08:59 +0200
committerJakub Kicinski <kuba@kernel.org>2025-09-22 11:51:24 -0700
commit3d7ae91107b839ffeeb19730a2e2a46e0054bae8 (patch)
treee525704d2266de15756f7216a72e9a5ab413d5a0 /net/mptcp
parentmptcp: pm: netlink: only add server-side attr when true (diff)
downloadlinux-3d7ae91107b839ffeeb19730a2e2a46e0054bae8.tar.gz
linux-3d7ae91107b839ffeeb19730a2e2a46e0054bae8.zip
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>
Diffstat (limited to 'net/mptcp')
-rw-r--r--net/mptcp/pm_netlink.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c
index 33a6bf536c02..aa0c73faaa6a 100644
--- a/net/mptcp/pm_netlink.c
+++ b/net/mptcp/pm_netlink.c
@@ -413,10 +413,13 @@ static int mptcp_event_created(struct sk_buff *skb,
if (err)
return err;
- /* only set when it is the server side */
- if (READ_ONCE(msk->pm.server_side) &&
- nla_put_u8(skb, MPTCP_ATTR_SERVER_SIDE, 1))
- return -EMSGSIZE;
+ if (READ_ONCE(msk->pm.server_side)) {
+ flags |= MPTCP_PM_EV_FLAG_SERVER_SIDE;
+
+ /* only set when it is the server side */
+ if (nla_put_u8(skb, MPTCP_ATTR_SERVER_SIDE, 1))
+ return -EMSGSIZE;
+ }
if (READ_ONCE(msk->pm.remote_deny_join_id0))
flags |= MPTCP_PM_EV_FLAG_DENY_JOIN_ID0;