Skip to content

Commit

Permalink
selftests: mptcp: join: fix 'delete and re-add' test
Browse files Browse the repository at this point in the history
mptcp_join 'delete and re-add' test fails when using ip mptcp:

$ ./mptcp_join.sh -iI
<snip>
002 delete and re-add                    before delete[ ok ]
                                         mptcp_info subflows=1         [ ok ]
Error: argument "ADDRESS" is wrong: invalid for non-zero id address
                                         after delete[fail] got 2:2 subflows expected 1

This happens because endpoint delete includes an ip address while id is
not 0, contrary to what is indicated in the ip mptcp man page:

"When used with the delete id operation, an IFADDR is only included when
the ID is 0."

This fixes the issue using the $addr variable in pm_nl_del_endpoint()
only when id is 0.

Fixes: 34aa6e3 ("selftests: mptcp: add ip mptcp wrappers")
Signed-off-by: Andrea Claudi <[email protected]>
  • Loading branch information
whispererindarkness authored and intel-lab-lkp committed Jul 27, 2023
1 parent f374771 commit 939fa9e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tools/testing/selftests/net/mptcp/mptcp_join.sh
Original file line number Diff line number Diff line change
Expand Up @@ -761,6 +761,7 @@ pm_nl_del_endpoint()
local addr=$3

if [ $ip_mptcp -eq 1 ]; then
[ $id -ne 0 ] && addr=''
ip -n $ns mptcp endpoint delete id $id $addr
else
ip netns exec $ns ./pm_nl_ctl del $id $addr
Expand Down

0 comments on commit 939fa9e

Please sign in to comment.