selftests: mptcp: use += operator to append strings
authorGeliang Tang <tanggeliang@kylinos.cn>
Fri, 8 Mar 2024 22:10:15 +0000 (23:10 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Apr 2024 09:19:33 +0000 (11:19 +0200)
commit732752bac3bd81f6c2559dc2741946a422703f5b
treea111cfa53288fddd20b1a4dace73e8d0785f88c8
parent4c6d2f453970c9f42a4f2af685a147069fb977b3
selftests: mptcp: use += operator to append strings

commit e7c42bf4d320affe37337aa83ae0347832b3f568 upstream.

This patch uses addition assignment operator (+=) to append strings
instead of duplicating the variable name in mptcp_connect.sh and
mptcp_join.sh.

This can make the statements shorter.

Note: in mptcp_connect.sh, add a local variable extra in do_transfer to
save the various extra warning logs, using += to append it. And add a
new variable tc_info to save various tc info, also using += to append it.
This can make the code more readable and prepare for the next commit.

Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Link: https://lore.kernel.org/r/20240308-upstream-net-next-20240308-selftests-mptcp-unification-v1-8-4f42c347b653@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
[ Conflicts in mptcp_connect.sh: this commit was supposed to be
  backported before commit 7a1b3490f47e ("mptcp: don't account accept()
  of non-MPC client as fallback to TCP"). The new condition added by
  this commit was then not expected, and was in fact at the wrong place
  in v6.6: in case of issue, the problem would not have been reported
  correctly. ]
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
tools/testing/selftests/net/mptcp/mptcp_connect.sh
tools/testing/selftests/net/mptcp/mptcp_join.sh