linux/tools/testing/selftests/net/mptcp
Matthieu Baerts 6254ad4088 selftests: mptcp: avoid calling pm_nl_ctl with bad IDs
IDs are supposed to be between 0 and 255.

In pm_nl_ctl, for both the 'add' and 'get' instruction, the ID is casted
in a u_int8_t. So if we give 256, we will delete ID 0. Obviously, the
goal is not to delete this ID by giving 256.

We could modify pm_nl_ctl and stop if the ID is negative or higher than
255 but probably better not to increase the number of lines for such
things in this tool which is only used in selftests. Instead, we use it
within the limits.

This modification also means that we will no longer add a new ID for the
2nd entry. That's why we removed an expected entry from the dump and
introduced with
commit dc8eb10e95 ("selftests: mptcp: add testcases for setting the address ID").

So now we delete ID 9 like before and we add entries for IDs 10 to 255
that are deleted just after.

Note that this could be seen as a fix but it was not really an issue so
far: we were simply playing with ID 0/1 once again. With the following
commit ("selftests: mptcp: add addr argument for del_addr"), it will be
different because ID 0 is going to required an address. We don't want
errors when trying to delete ID 0 without the address argument.

Acked-and-tested-by: Geliang Tang <geliangtang@gmail.com>
Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2021-03-30 17:42:23 -07:00
..
.gitignore SPDX patches for 5.7-rc1. 2020-04-03 13:12:26 -07:00
config selftests: mptcp: add ADD_ADDR timeout test case 2020-11-04 17:45:53 -08:00
diag.sh selftests/mptcp: add diag interface tests 2020-07-09 12:38:41 -07:00
Makefile mptcp: simult flow self-tests 2020-09-14 13:28:03 -07:00
mptcp_connect.c selftests: mptcp: add cfg_do_w for cfg_remove 2021-03-26 15:05:15 -07:00
mptcp_connect.sh selftests: mptcp: fail if not enough SYN/3rd ACK 2021-02-12 16:20:34 -08:00
mptcp_join.sh selftests: mptcp: signal addresses testcases 2021-03-26 15:05:15 -07:00
pm_netlink.sh selftests: mptcp: avoid calling pm_nl_ctl with bad IDs 2021-03-30 17:42:23 -07:00
pm_nl_ctl.c selftests: mptcp: add port argument for pm_nl_ctl 2021-02-02 18:37:19 -08:00
settings selftests: increase timeout to 10 min 2021-01-27 16:53:55 -08:00
simult_flows.sh mptcp: push pending frames when subflow has free space 2020-12-17 10:24:47 -08:00