linux-stable/net/mptcp
YonglongLi 40eec1795c mptcp: pm: update add_addr counters after connect
The creation of new subflows can fail for different reasons. If no
subflow have been created using the received ADD_ADDR, the related
counters should not be updated, otherwise they will never be decremented
for events related to this ID later on.

For the moment, the number of accepted ADD_ADDR is only decremented upon
the reception of a related RM_ADDR, and only if the remote address ID is
currently being used by at least one subflow. In other words, if no
subflow can be created with the received address, the counter will not
be decremented. In this case, it is then important not to increment
pm.add_addr_accepted counter, and not to modify pm.accept_addr bit.

Note that this patch does not modify the behaviour in case of failures
later on, e.g. if the MP Join is dropped or rejected.

The "remove invalid addresses" MP Join subtest has been modified to
validate this case. The broadcast IP address is added before the "valid"
address that will be used to successfully create a subflow, and the
limit is decreased by one: without this patch, it was not possible to
create the last subflow, because:

- the broadcast address would have been accepted even if it was not
  usable: the creation of a subflow to this address results in an error,

- the limit of 2 accepted ADD_ADDR would have then been reached.

Fixes: 01cacb00b3 ("mptcp: add netlink-based PM")
Cc: stable@vger.kernel.org
Co-developed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Signed-off-by: YonglongLi <liyonglong@chinatelecom.cn>
Reviewed-by: Mat Martineau <martineau@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Link: https://lore.kernel.org/r/20240607-upstream-net-20240607-misc-fixes-v1-3-1ab9ddfa3d00@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2024-06-10 19:49:10 -07:00
..
Kconfig kunit: mptcp: adhere to KUNIT formatting standard 2021-04-16 17:10:40 -07:00
Makefile net: mptcp: use policy generated by YAML spec 2023-10-24 13:00:32 -07:00
bpf.c bpf: Add update_socket_protocol hook 2023-08-16 10:22:16 -07:00
crypto.c kunit: mptcp: adhere to KUNIT formatting standard 2021-04-16 17:10:40 -07:00
crypto_test.c mptcp: fill in missing MODULE_DESCRIPTION() 2023-12-17 20:54:22 +00:00
ctrl.c mptcp: prefer strscpy over strcpy 2024-05-13 18:29:23 -07:00
diag.c mptcp: drop duplicate header inclusions 2024-03-06 20:24:10 -08:00
fastopen.c mptcp: corner case locking for rx path fields initialization 2024-02-12 10:08:13 +00:00
mib.c mptcp: add CurrEstab MIB counter support 2024-01-02 13:32:45 +00:00
mib.h mptcp: include inet_common in mib.h 2024-05-13 18:29:23 -07:00
mptcp_diag.c mptcp: drop duplicate header inclusions 2024-03-06 20:24:10 -08:00
mptcp_pm_gen.c mptcp: add token for get-addr in yaml 2024-03-04 13:07:45 +00:00
mptcp_pm_gen.h mptcp: add token for get-addr in yaml 2024-03-04 13:07:45 +00:00
options.c mptcp: add last time fields in mptcp_info 2024-04-11 08:19:54 -07:00
pm.c mptcp: update set_flags interfaces 2024-03-06 20:24:10 -08:00
pm_netlink.c mptcp: pm: update add_addr counters after connect 2024-06-10 19:49:10 -07:00
pm_userspace.c mptcp: move mptcp_pm_gen.h's include 2024-05-13 18:29:23 -07:00
protocol.c mptcp: ensure snd_una is properly initialized on connect 2024-06-10 19:49:10 -07:00
protocol.h mptcp: move mptcp_pm_gen.h's include 2024-05-13 18:29:23 -07:00
sched.c mptcp: add net.mptcp.available_schedulers 2024-05-13 18:29:23 -07:00
sockopt.c mptcp: prefer strscpy over strcpy 2024-05-13 18:29:23 -07:00
subflow.c mptcp: remove unnecessary else statements 2024-05-13 18:29:23 -07:00
syncookies.c mptcp: don't return sockets in foreign netns 2021-09-24 10:51:36 +01:00
token.c mptcp: add statistics for mptcp socket in use 2023-01-09 07:30:50 +00:00
token_test.c mptcp: token kunit: set protocol 2024-02-26 18:42:12 -08:00