Module Name: src
Committed By: yamaguchi
Date: Wed Jul 14 06:36:00 UTC 2021
Modified Files:
src/tests/net/if_vlan: t_vlan.sh
Log Message:
Added a test about clearing IFF_PROMISC at vlan_unconfig
This test is related to PR/49196
To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/tests/net/if_vlan/t_vlan.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/if_vlan/t_vlan.sh
diff -u src/tests/net/if_vlan/t_vlan.sh:1.20 src/tests/net/if_vlan/t_vlan.sh:1.21
--- src/tests/net/if_vlan/t_vlan.sh:1.20 Fri Jul 9 05:54:11 2021
+++ src/tests/net/if_vlan/t_vlan.sh Wed Jul 14 06:35:59 2021
@@ -1,4 +1,4 @@
-# $NetBSD: t_vlan.sh,v 1.20 2021/07/09 05:54:11 yamaguchi Exp $
+# $NetBSD: t_vlan.sh,v 1.21 2021/07/14 06:35:59 yamaguchi Exp $
#
# Copyright (c) 2016 Internet Initiative Japan Inc.
# All rights reserved.
@@ -986,6 +986,27 @@ vlan_promisc_body()
atf_check -s exit:0 -o not-match:'PROMISC' rump.ifconfig vlan0
atf_check -s exit:0 -o not-match:'PROMISC' rump.ifconfig shmif0
+ $atf_ifconfig vlan0 -vlanif
+
+ #
+ # clear IFF_PROMISC after bpf_detach called from ether_ifdetach
+ #
+ $atf_ifconfig vlan0 vlan 1 vlanif shmif0
+ $atf_ifconfig vlan0 up
+
+ $bpfopen -r vlan0 &
+ pid=$!
+
+ atf_check -s exit:0 -o match:'PROMISC' rump.ifconfig vlan0
+ atf_check -s exit:0 -o match:'PROMISC' rump.ifconfig shmif0
+
+ $atf_ifconfig vlan0 -vlanif
+
+ atf_check -s exit:0 -o not-match:'PROMISC' rump.ifconfig vlan0
+ atf_check -s exit:0 -o not-match:'PROMISC' rump.ifconfig shmif0
+
+ kill -TERM $pid
+ atf_check -s exit:0 -o not-match:'PROMISC' rump.ifconfig vlan0
}
vlan_promisc_cleanup()