Skip to contentSkip to conversation

selftests: net: udpgro_fwd.sh: Use ping6 on systems where ping doesn't handle IPv6

PATCH In review Jianguo Wu 2 participants 3 messages Dec 31, 2021

Subsystems (3)
lore
Share & tools
lore

Jianguo Wu

author
#0 lore raw

PATCH v2 1/1 selftests: net: udpgro_fwd.sh: Use ping6 on systems where ping doesn't handle IPv6

From: Jianguo Wu <[email protected]>

In CentOS7(iputils-20160308-10.el7.x86_64), udpgro_fwd.sh output following message:
ping: 2001:db8:1::100: Address family for hostname not supported

Use ping6 on systems where ping doesn't handle IPv6.

v1 -> v2:
- explicitly checking the available ping feature, as e.g. do the bareudp.sh self-tests.(Paolo)

Fixes a062260a9d5f ("selftests: net: add UDP GRO forwarding self-tests")
---
 tools/testing/selftests/net/udpgro_fwd.sh | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
tools/testing/selftests/net/udpgro_fwd.sh +4 -1
index 6a3985b..6f05e06 100755
@@ -185,6 +185,7 @@ for family in 4 6; do
 	IPT=iptables
 	SUFFIX=24
 	VXDEV=vxlan
+	PING=ping
 
 	if [ $family = 6 ]; then
 		BM_NET=$BM_NET_V6
@@ -192,6 +193,8 @@ for family in 4 6; do
 		SUFFIX="64 nodad"
 		VXDEV=vxlan6
 		IPT=ip6tables
+		# Use ping6 on systems where ping doesn't handle IPv6
+		ping -w 1 -c 1 ::1 > /dev/null 2>&1 || PING="ping6"
 	fi
 
 	echo "IPv$family"
@@ -237,7 +240,7 @@ for family in 4 6; do
 
 	# load arp cache before running the test to reduce the amount of
 	# stray traffic on top of the UDP tunnel
-	ip netns exec $NS_SRC ping -q -c 1 $OL_NET$DST_NAT >/dev/null
+	ip netns exec $NS_SRC $PING -q -c 1 $OL_NET$DST_NAT >/dev/null
 	run_test "GRO fwd over UDP tunnel" $OL_NET$DST_NAT 1 1 $OL_NET$DST
 	cleanup
 
Signature · 1 line
1.8.3.1
maintainer
#1 lore raw
Quoted 6 lines · On Fri, 31 Dec 2021 09:10:00 +0800 Jianguo Wu wrote:

From: Jianguo Wu <[email protected]>

In CentOS7(iputils-20160308-10.el7.x86_64), udpgro_fwd.sh output following message:
ping: 2001:db8:1::100: Address family for hostname not supported

Quoted 8 lines

Use ping6 on systems where ping doesn't handle IPv6.

v1 -> v2:
- explicitly checking the available ping feature, as e.g. do the bareudp.sh self-tests.(Paolo)

Fixes a062260a9d5f ("selftests: net: add UDP GRO forwarding self-tests")

I'm afraid v1 got silently applied, see 8b3170e07539 ("selftests: net:
using ping6 for IPv6 in udpgro_fwd.sh") upstream. Could you send an incremental patch?

author
#2 lore raw
Quoted 13 lines · Jakub Kicinski
Quoted 12 lines · On Fri, 31 Dec 2021 09:10:00 +0800 Jianguo Wu wrote:

From: Jianguo Wu <[email protected]>

In CentOS7(iputils-20160308-10.el7.x86_64), udpgro_fwd.sh output following message:
ping: 2001:db8:1::100: Address family for hostname not supported

Use ping6 on systems where ping doesn't handle IPv6.

v1 -> v2:
- explicitly checking the available ping feature, as e.g. do the bareudp.sh self-tests.(Paolo)

Quoted 6 lines
Quoted 2 lines
Fixes a062260a9d5f ("selftests: net: add UDP GRO forwarding self-tests")

I'm afraid v1 got silently applied, see 8b3170e07539 ("selftests: net:
using ping6 for IPv6 in udpgro_fwd.sh") upstream. Could you send an incremental patch?

OK, I will send an incremental patch.

Thanks!

Jianguo