linux/net
Matthieu Baerts (NGI0) 06c62385be 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>
2026-06-11 15:33:37 -07:00
..
6lowpan 6lowpan: fix off-by-one in multicast context address compression 2026-06-01 19:10:16 -07:00
9p 9p/trans_xen: replace simple_strto* with kstrtouint 2026-04-16 02:57:01 +00:00
802 fddi: validate skb length before parsing headers 2026-06-10 08:12:33 -07:00
8021q 8021q: delete cleared egress QoS mappings 2026-04-23 12:13:57 +02:00
appletalk appletalk: aarp: zero-initialize aarp_entry to prevent heap info leak 2026-06-03 18:08:58 -07:00
atm atm: convert to getsockopt_iter 2026-05-22 11:11:09 -07:00
batman-adv batman-adv: fix kernel-doc typos and grammar errors 2026-06-05 09:12:09 +02:00
bluetooth Bluetooth: MGMT: Fix backward compatibility with userspace 2026-06-03 11:24:12 -04:00
bpf bpf: reject short IPv4/IPv6 inputs in bpf_prog_test_run_skb 2026-04-12 15:42:57 -07:00
bridge Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2026-06-11 14:33:35 -07:00
can Networking changes for 7.1. 2026-04-14 18:36:10 -07:00
ceph libceph: Fix potential null-ptr-deref in decode_choose_args() 2026-05-12 21:00:59 +02:00
core Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2026-06-11 14:33:35 -07:00
dcb Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
devlink Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2026-06-04 15:29:04 -07:00
dns_resolver net/dns_resolver: use kasprintf + kmemdup_nul to simplify dns_query 2026-06-04 18:39:29 -07:00
dsa net: dsa: tag_yt921x: handle ACL tag code 2026-06-10 08:26:05 -07:00
ethernet bonding: prevent potential infinite loop in bond_header_parse() 2026-03-16 19:29:45 -07:00
ethtool net: ethtool: optionally skip rtnl_lock on IOCTL path 2026-06-09 10:13:06 -07:00
handshake net/handshake: Drain pending requests at net namespace exit 2026-05-28 13:35:32 +02:00
hsr hsr: broadcast netlink notifications in the device's net namespace 2026-06-05 18:23:12 -07:00
ieee802154 ieee802154: 6lowpan: only accept IPv6 packets in lowpan_xmit() 2026-06-04 08:51:32 -07:00
ife
ipv4 ipmr: Convert mr_table.cache_resolve_queue_len to u32. 2026-06-11 15:17:30 -07:00
ipv6 ipmr: Convert mr_table.cache_resolve_queue_len to u32. 2026-06-11 15:17:30 -07:00
iucv Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2026-05-28 14:02:21 -07:00
kcm kcm: convert to getsockopt_iter 2026-05-10 10:11:08 -07:00
key xfrm: route MIGRATE notifications to caller's netns 2026-05-07 09:31:10 +02:00
l2tp Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2026-06-04 15:29:04 -07:00
l3mdev
lapb treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
llc llc: Add SPDX id lines to some llc source files 2026-05-26 17:26:57 -07:00
mac80211 Quite a few last updates, notably: 2026-06-10 07:59:45 -07:00
mac802154 bonding: prevent potential infinite loop in bond_header_parse() 2026-03-16 19:29:45 -07:00
mctp mctp: convert to getsockopt_iter 2026-05-10 10:11:07 -07:00
mpls net: Remove rtnl_held of struct fib_dump_filter. 2026-06-08 17:06:23 -07:00
mptcp mptcp: pm: avoid computing add_addr size twice 2026-06-11 15:33:37 -07:00
ncsi net: ncsi: fix skb leak in error paths 2026-03-06 17:34:48 -08:00
netfilter Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2026-06-11 14:33:35 -07:00
netlabel Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2026-06-11 14:33:35 -07:00
netlink Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2026-05-28 14:02:21 -07:00
nfc nfc: hci: fix out-of-bounds read in HCP header parsing 2026-05-07 12:42:09 +02:00
nsh
openvswitch net: openvswitch: fix possible kfree_skb of ERR_PTR 2026-06-08 20:13:02 -07:00
packet net/packet: fix TOCTOU race on mmap'd vnet_hdr in tpacket_snd() 2026-04-22 20:16:34 -07:00
phonet net: phonet: free phonet_device after RCU grace period 2026-06-08 17:37:07 -07:00
psample treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
psp Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2026-05-07 11:19:07 -07:00
qrtr Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2026-06-11 14:33:35 -07:00
rds Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2026-06-11 14:33:35 -07:00
rfkill rfkill: Replace strcpy() with memcpy() 2026-06-10 10:22:47 +02:00
rxrpc Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2026-06-11 14:33:35 -07:00
sched net: sched: avoid printing uninitialized link speed 2026-06-11 15:44:55 +02:00
sctp Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2026-06-11 14:33:35 -07:00
shaper net: shaper: add a note that we expect cap dumps to be tiny 2026-06-11 12:55:23 +02:00
smc Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2026-05-28 14:02:21 -07:00
strparser net: strparser: fix skb_head leak in strp_abort_strp() 2026-04-14 12:37:00 +02:00
sunrpc nfsd-7.1 fixes: 2026-05-26 13:49:13 -07:00
switchdev bridge: No DEV_PATH_BR_VLAN_UNTAG_HW for dsa foreign 2026-03-19 13:14:00 +01:00
tipc tipc: convert to getsockopt_iter 2026-05-22 11:11:10 -07:00
tls tls: Flush backlog before waiting for a new record 2026-06-08 20:10:21 -07:00
unix Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2026-06-04 15:29:04 -07:00
vmw_vsock Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2026-06-04 15:29:04 -07:00
wireless Quite a few last updates, notably: 2026-06-10 07:59:45 -07:00
x25 x25: convert to getsockopt_iter 2026-05-10 10:11:08 -07:00
xdp Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2026-06-04 15:29:04 -07:00
xfrm xfrm: espintcp: do not reuse an in-progress partial send 2026-06-05 13:20:03 +02:00
compat.c socket: Unify getsockname and getpeername implementation 2025-11-26 13:45:23 -07:00
devres.c
Kconfig net: remove ax25 and amateur radio (hamradio) subsystem 2026-04-23 10:24:02 -07:00
Kconfig.debug
Makefile net: remove ax25 and amateur radio (hamradio) subsystem 2026-04-23 10:24:02 -07:00
socket.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2026-06-11 14:33:35 -07:00
sysctl_net.c