Module Name:    src
Committed By:   ozaki-r
Date:           Mon Feb 17 08:46:10 UTC 2020

Modified Files:
        src/tests/net/ipsec: t_ipsec_gif.sh t_ipsec_l2tp.sh

Log Message:
tests: add missing ifconfig -w

This change mitigates PR kern/54897.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/tests/net/ipsec/t_ipsec_gif.sh \
    src/tests/net/ipsec/t_ipsec_l2tp.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/net/ipsec/t_ipsec_gif.sh
diff -u src/tests/net/ipsec/t_ipsec_gif.sh:1.8 src/tests/net/ipsec/t_ipsec_gif.sh:1.9
--- src/tests/net/ipsec/t_ipsec_gif.sh:1.8	Mon Aug 19 03:22:05 2019
+++ src/tests/net/ipsec/t_ipsec_gif.sh	Mon Feb 17 08:46:10 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: t_ipsec_gif.sh,v 1.8 2019/08/19 03:22:05 ozaki-r Exp $
+#	$NetBSD: t_ipsec_gif.sh,v 1.9 2020/02/17 08:46:10 ozaki-r Exp $
 #
 # Copyright (c) 2017 Internet Initiative Japan Inc.
 # All rights reserved.
@@ -59,6 +59,15 @@ make_gif_pktstr()
 	echo "$src > $dst: $proto_cap.+$inner_str"
 }
 
+wait_for_all_dad_completions()
+{
+
+	for sock in $SOCK_LOCAL $SOCK_TUN_LOCAL $SOCK_TUN_REMOTE $SOCK_REMOTE; do
+		export RUMP_SERVER=$sock
+		atf_check -s exit:0 rump.ifconfig -w 10
+	done
+}
+
 test_ipsec4_gif()
 {
 	local mode=$1
@@ -121,8 +130,9 @@ test_ipsec4_gif()
 
 	export RUMP_SERVER=$SOCK_REMOTE
 	atf_check -s exit:0 rump.ifconfig shmif0 $ip_remote/24
-	# Run ifconfig -w 10 just once for optimization
-	atf_check -s exit:0 rump.ifconfig -w 10
+
+	wait_for_all_dad_completions
+
 	atf_check -s exit:0 -o ignore \
 	    rump.route -n add -net $subnet_local $ip_gw_remote
 
@@ -273,8 +283,9 @@ test_ipsec6_gif()
 
 	export RUMP_SERVER=$SOCK_REMOTE
 	atf_check -s exit:0 rump.ifconfig shmif0 inet6 $ip_remote
-	# Run ifconfig -w 10 just once for optimization
-	atf_check -s exit:0 rump.ifconfig -w 10
+
+	wait_for_all_dad_completions
+
 	atf_check -s exit:0 -o ignore \
 	    rump.route -n add -inet6 -net $subnet_local/64 $ip_gw_remote
 
Index: src/tests/net/ipsec/t_ipsec_l2tp.sh
diff -u src/tests/net/ipsec/t_ipsec_l2tp.sh:1.8 src/tests/net/ipsec/t_ipsec_l2tp.sh:1.9
--- src/tests/net/ipsec/t_ipsec_l2tp.sh:1.8	Mon Aug 19 03:22:05 2019
+++ src/tests/net/ipsec/t_ipsec_l2tp.sh	Mon Feb 17 08:46:10 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: t_ipsec_l2tp.sh,v 1.8 2019/08/19 03:22:05 ozaki-r Exp $
+#	$NetBSD: t_ipsec_l2tp.sh,v 1.9 2020/02/17 08:46:10 ozaki-r Exp $
 #
 # Copyright (c) 2017 Internet Initiative Japan Inc.
 # All rights reserved.
@@ -62,6 +62,15 @@ make_l2tp_pktstr()
 	echo "$src > $dst: $proto_cap.+$proto_str"
 }
 
+wait_for_all_dad_completions()
+{
+
+	for sock in $SOCK_LOCAL $SOCK_TUN_LOCAL $SOCK_TUN_REMOTE $SOCK_REMOTE; do
+		export RUMP_SERVER=$sock
+		atf_check -s exit:0 rump.ifconfig -w 10
+	done
+}
+
 test_ipsec4_l2tp()
 {
 	local mode=$1
@@ -121,8 +130,8 @@ test_ipsec4_l2tp()
 
 	export RUMP_SERVER=$SOCK_REMOTE
 	atf_check -s exit:0 rump.ifconfig shmif0 $ip_remote/24
-	# Run ifconfig -w 10 just once for optimization
-	atf_check -s exit:0 rump.ifconfig -w 10
+
+	wait_for_all_dad_completions
 
 	extract_new_packets $BUS_TUNNEL > $outfile
 
@@ -263,8 +272,8 @@ test_ipsec6_l2tp()
 
 	export RUMP_SERVER=$SOCK_REMOTE
 	atf_check -s exit:0 rump.ifconfig shmif0 inet6 $ip_remote
-	# Run ifconfig -w 10 just once for optimization
-	atf_check -s exit:0 rump.ifconfig -w 10
+
+	wait_for_all_dad_completions
 
 	extract_new_packets $BUS_TUNNEL > $outfile
 

Reply via email to