aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorMatthieu Baerts (NGI0) <matttbe@kernel.org>2025-09-19 14:08:58 +0200
committerJakub Kicinski <kuba@kernel.org>2025-09-22 11:51:24 -0700
commitc9809f03c158f07eaa76c7dd3606fc0a184520f2 (patch)
tree3272a0707a3ff2018a6868618e514f10159d7d55 /net
parentnet: spacemit: Make stats_lock softirq-safe (diff)
downloadlinux-c9809f03c158f07eaa76c7dd3606fc0a184520f2.tar.gz
linux-c9809f03c158f07eaa76c7dd3606fc0a184520f2.zip
mptcp: pm: netlink: only add server-side attr when true
This attribute is a boolean. No need to add it to set it to 'false'. Indeed, the default value when this attribute is not set is naturally 'false'. A few bytes can then be saved by not adding this attribute if the connection is not on the server side. This prepares the future deprecation of its attribute, in favour of a new flag. 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-1-a97a5d561a8b@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net')
-rw-r--r--net/mptcp/pm_netlink.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c
index 483ddbb9ec40..33a6bf536c02 100644
--- a/net/mptcp/pm_netlink.c
+++ b/net/mptcp/pm_netlink.c
@@ -413,7 +413,9 @@ static int mptcp_event_created(struct sk_buff *skb,
if (err)
return err;
- if (nla_put_u8(skb, MPTCP_ATTR_SERVER_SIDE, READ_ONCE(msk->pm.server_side)))
+ /* 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.remote_deny_join_id0))