diff options
| author | Matthieu Baerts (NGI0) <matttbe@kernel.org> | 2025-09-19 14:08:58 +0200 |
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2025-09-22 11:51:24 -0700 |
| commit | c9809f03c158f07eaa76c7dd3606fc0a184520f2 (patch) | |
| tree | 3272a0707a3ff2018a6868618e514f10159d7d55 /net | |
| parent | net: spacemit: Make stats_lock softirq-safe (diff) | |
| download | linux-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.c | 4 |
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)) |
