netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [net PATCH 1/2] selftests: net: lib: fix broken ping with coreutils ping util
@ 2024-11-30 11:33 Christian Marangi
  2024-11-30 11:33 ` [net PATCH 2/2] selftests: forwarding: local_termination: sleep before starting tests Christian Marangi
  2024-11-30 15:43 ` [net PATCH 1/2] selftests: net: lib: fix broken ping with coreutils ping util Vladimir Oltean
  0 siblings, 2 replies; 11+ messages in thread
From: Christian Marangi @ 2024-11-30 11:33 UTC (permalink / raw)
  To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Shuah Khan, Petr Machata, Benjamin Poirier, Hangbin Liu,
	Jiri Pirko, Vladimir Oltean, Christian Marangi, Ido Schimmel,
	netdev, linux-kselftest, linux-kernel
  Cc: stable

If the coreutils variant of ping is used instead of the busybox one, the
ping_do() command is broken. This comes by the fact that for coreutils
ping, the ping IP needs to be the very last elements.

To handle this, reorder the ping args and make $dip last element.

The use of coreutils ping might be useful for case where busybox is not
compiled with float interval support and ping command doesn't support
0.1 interval. (in such case a dedicated ping utility is installed
instead)

Cc: stable@vger.kernel.org
Fixes: 73bae6736b6b ("selftests: forwarding: Add initial testing framework")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
---
 tools/testing/selftests/net/forwarding/lib.sh | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/testing/selftests/net/forwarding/lib.sh b/tools/testing/selftests/net/forwarding/lib.sh
index c992e385159c..2060f95d5c62 100644
--- a/tools/testing/selftests/net/forwarding/lib.sh
+++ b/tools/testing/selftests/net/forwarding/lib.sh
@@ -1473,8 +1473,8 @@ ping_do()
 
 	vrf_name=$(master_name_get $if_name)
 	ip vrf exec $vrf_name \
-		$PING $args $dip -c $PING_COUNT -i 0.1 \
-		-w $PING_TIMEOUT &> /dev/null
+		$PING $args -c $PING_COUNT -i 0.1 \
+		-w $PING_TIMEOUT $dip &> /dev/null
 }
 
 ping_test()
@@ -1504,8 +1504,8 @@ ping6_do()
 
 	vrf_name=$(master_name_get $if_name)
 	ip vrf exec $vrf_name \
-		$PING6 $args $dip -c $PING_COUNT -i 0.1 \
-		-w $PING_TIMEOUT &> /dev/null
+		$PING6 $args -c $PING_COUNT -i 0.1 \
+		-w $PING_TIMEOUT $dip &> /dev/null
 }
 
 ping6_test()
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2024-12-03 11:46 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-30 11:33 [net PATCH 1/2] selftests: net: lib: fix broken ping with coreutils ping util Christian Marangi
2024-11-30 11:33 ` [net PATCH 2/2] selftests: forwarding: local_termination: sleep before starting tests Christian Marangi
2024-12-02 11:52   ` Vladimir Oltean
2024-11-30 15:43 ` [net PATCH 1/2] selftests: net: lib: fix broken ping with coreutils ping util Vladimir Oltean
2024-11-30 15:46   ` Christian Marangi
2024-11-30 15:48     ` Vladimir Oltean
2024-12-02 20:39       ` Christian Marangi
2024-12-02 21:24         ` Vladimir Oltean
2024-12-02 21:28           ` Christian Marangi
2024-12-02 21:29             ` Christian Marangi
2024-12-03 11:46               ` Vladimir Oltean

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).