]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
selftests: forwarding: Reorder (ar)ping arguments to obey POSIX getopt
authorDavid Yang <mmyangfl@gmail.com>
Fri, 19 Sep 2025 05:35:33 +0000 (13:35 +0800)
committerJakub Kicinski <kuba@kernel.org>
Mon, 22 Sep 2025 18:37:20 +0000 (11:37 -0700)
commit50d51cef555ee42fe47dd51b71366a77895e5f0b
tree12b467e07ed000ad07f44538a8820ac11813f60a
parent312e6f7676e63bbb9b81e5c68e580a9f776cc6f0
selftests: forwarding: Reorder (ar)ping arguments to obey POSIX getopt

Quoted from musl wiki:

  GNU getopt permutes argv to pull options to the front, ahead of
  non-option arguments. musl and the POSIX standard getopt stop
  processing options at the first non-option argument with no
  permutation.

Thus these scripts stop working on musl since non-option arguments for
tools using getopt() (in this case, (ar)ping) do not always come last.
Fix it by reordering arguments.

Signed-off-by: David Yang <mmyangfl@gmail.com>
Reviewed-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Link: https://patch.msgid.link/20250919053538.1106753-1-mmyangfl@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/net/forwarding/custom_multipath_hash.sh
tools/testing/selftests/net/forwarding/gre_custom_multipath_hash.sh
tools/testing/selftests/net/forwarding/ip6_forward_instats_vrf.sh
tools/testing/selftests/net/forwarding/ip6gre_custom_multipath_hash.sh
tools/testing/selftests/net/forwarding/lib.sh
tools/testing/selftests/net/forwarding/mirror_gre_bridge_1q_lag.sh
tools/testing/selftests/net/forwarding/mirror_gre_vlan_bridge_1q.sh