summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorMatthieu Baerts (NGI0) <matttbe@kernel.org>2026-06-05 12:21:47 +0300
committerJakub Kicinski <kuba@kernel.org>2026-06-12 01:33:37 +0300
commit06c62385be856bc96acc0f49465a85fd047c77ad (patch)
tree16dca18266e3fbbce7b0a2f3aa0ac2c3e0839c32 /tools
parenta8bffec089d5b9d02f08db738eaaff695f77b6b3 (diff)
downloadlinux-06c62385be856bc96acc0f49465a85fd047c77ad.tar.xz
mptcp: pm: avoid computing add_addr size twice
mptcp_add_addr_len helper was called twice: in mptcp_pm_add_addr_signal, then just after in mptcp_established_options_add_addr. Both to check the remaining space. The second call is not needed: if there is not enough space, mptcp_pm_add_addr_signal will return false, and the caller, mptcp_established_options_add_addr, will do the same without re-checking the size again. Instead, mptcp_pm_add_addr_signal can directly set the size. Note that the returned size can be negative when other suboptions are dropped, e.g. to send an echo ADD_ADDR with a v4 address, and no port. While at it: - move mptcp_add_addr_len to pm.c, as it is now only used from there - use 'int' in mptcp_add_addr_len for the size, instead of having a mix - use a bool for 'ret' in mptcp_pm_add_addr_signal Reviewed-by: Mat Martineau <martineau@kernel.org> Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org> Link: https://patch.msgid.link/20260605-net-next-mptcp-add-addr6-port-ts-v2-3-758e7ca73f4d@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'tools')
0 files changed, 0 insertions, 0 deletions