Skip to content

Commit 560edd9

Browse files
matttbekuba-moo
authored andcommitted
selftests: mptcp: join: check RM_ADDR not sent over same subflow
This validates the previous commit: RM_ADDR were sent over the first found active subflow which could be the same as the one being removed. It is more likely to loose this notification. For this check, RM_ADDR are explicitly dropped when trying to send them over the initial subflow, when removing the endpoint attached to it. If it is dropped, the test will complain because some RM_ADDR have not been received. Note that only the RM_ADDR are dropped, to allow the linked subflow to be quickly and cleanly closed. To only drop those RM_ADDR, a cBPF byte code is used. If the IPTables commands fail, that's OK, the tests will continue to pass, but not validate this part. This can be ignored: another subtest fully depends on such command, and will be marked as skipped. The 'Fixes' tag here below is the same as the one from the previous commit: this patch here is not fixing anything wrong in the selftests, but it validates the previous fix for an issue introduced by this commit ID. Fixes: 8dd5efb ("mptcp: send ack for rm_addr") Cc: stable@vger.kernel.org Reviewed-by: Mat Martineau <martineau@kernel.org> Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org> Link: https://patch.msgid.link/20260303-net-mptcp-misc-fixes-7-0-rc2-v1-3-4b5462b6f016@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent fb8d0bc commit 560edd9

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

tools/testing/selftests/net/mptcp/mptcp_join.sh

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,24 @@ CBPF_MPTCP_SUBOPTION_ADD_ADDR="14,
104104
6 0 0 65535,
105105
6 0 0 0"
106106

107+
# IPv4: TCP hdr of 48B, a first suboption of 12B (DACK8), the RM_ADDR suboption
108+
# generated using "nfbpf_compile '(ip[32] & 0xf0) == 0xc0 && ip[53] == 0x0c &&
109+
# (ip[66] & 0xf0) == 0x40'"
110+
CBPF_MPTCP_SUBOPTION_RM_ADDR="13,
111+
48 0 0 0,
112+
84 0 0 240,
113+
21 0 9 64,
114+
48 0 0 32,
115+
84 0 0 240,
116+
21 0 6 192,
117+
48 0 0 53,
118+
21 0 4 12,
119+
48 0 0 66,
120+
84 0 0 240,
121+
21 0 1 64,
122+
6 0 0 65535,
123+
6 0 0 0"
124+
107125
init_partial()
108126
{
109127
capout=$(mktemp)
@@ -4217,6 +4235,14 @@ endpoint_tests()
42174235
chk_subflow_nr "after no reject" 3
42184236
chk_mptcp_info subflows 2 subflows 2
42194237

4238+
# To make sure RM_ADDR are sent over a different subflow, but
4239+
# allow the rest to quickly and cleanly close the subflow
4240+
local ipt=1
4241+
ip netns exec "${ns2}" ${iptables} -I OUTPUT -s "10.0.1.2" \
4242+
-p tcp -m tcp --tcp-option 30 \
4243+
-m bpf --bytecode \
4244+
"$CBPF_MPTCP_SUBOPTION_RM_ADDR" \
4245+
-j DROP || ipt=0
42204246
local i
42214247
for i in $(seq 3); do
42224248
pm_nl_del_endpoint $ns2 1 10.0.1.2
@@ -4229,6 +4255,7 @@ endpoint_tests()
42294255
chk_subflow_nr "after re-add id 0 ($i)" 3
42304256
chk_mptcp_info subflows 3 subflows 3
42314257
done
4258+
[ ${ipt} = 1 ] && ip netns exec "${ns2}" ${iptables} -D OUTPUT 1
42324259

42334260
mptcp_lib_kill_group_wait $tests_pid
42344261

@@ -4288,11 +4315,20 @@ endpoint_tests()
42884315
chk_mptcp_info subflows 2 subflows 2
42894316
chk_mptcp_info add_addr_signal 2 add_addr_accepted 2
42904317

4318+
# To make sure RM_ADDR are sent over a different subflow, but
4319+
# allow the rest to quickly and cleanly close the subflow
4320+
local ipt=1
4321+
ip netns exec "${ns1}" ${iptables} -I OUTPUT -s "10.0.1.1" \
4322+
-p tcp -m tcp --tcp-option 30 \
4323+
-m bpf --bytecode \
4324+
"$CBPF_MPTCP_SUBOPTION_RM_ADDR" \
4325+
-j DROP || ipt=0
42914326
pm_nl_del_endpoint $ns1 42 10.0.1.1
42924327
sleep 0.5
42934328
chk_subflow_nr "after delete ID 0" 2
42944329
chk_mptcp_info subflows 2 subflows 2
42954330
chk_mptcp_info add_addr_signal 2 add_addr_accepted 2
4331+
[ ${ipt} = 1 ] && ip netns exec "${ns1}" ${iptables} -D OUTPUT 1
42964332

42974333
pm_nl_add_endpoint $ns1 10.0.1.1 id 99 flags signal
42984334
wait_mpj 4

0 commit comments

Comments
 (0)