svn commit: r325020 - head/tests/sys/netpfil/pf

Kristof Provost kp at FreeBSD.org
Thu Oct 26 20:53:57 UTC 2017


Author: kp
Date: Thu Oct 26 20:53:56 2017
New Revision: 325020
URL: https://svnweb.freebsd.org/changeset/base/325020

Log:
  pf tests: destroy jails before destroying interfaces
  
  When cleaning up we must destroy the jails before we destroy the interfaces.
  Otherwise we might try to destroy interfaces that belong to a jail, which won't
  work and fail to completely clean up.

Modified:
  head/tests/sys/netpfil/pf/utils.subr

Modified: head/tests/sys/netpfil/pf/utils.subr
==============================================================================
--- head/tests/sys/netpfil/pf/utils.subr	Thu Oct 26 20:44:42 2017	(r325019)
+++ head/tests/sys/netpfil/pf/utils.subr	Thu Oct 26 20:53:56 2017	(r325020)
@@ -51,17 +51,17 @@ pft_set_rules()
 
 pft_cleanup()
 {
-	if [ -f created_interfaces.lst ]; then
-		for ifname in `cat created_interfaces.lst`
+	if [ -f created_jails.lst ]; then
+		for jailname in `cat created_jails.lst`
 		do
-			ifconfig ${ifname} destroy
+			jail -r ${jailname}
 		done
 	fi
 
-	if [ -f created_jails.lst ]; then
-		for jailname in `cat created_jails.lst`
+	if [ -f created_interfaces.lst ]; then
+		for ifname in `cat created_interfaces.lst`
 		do
-			jail -r ${jailname}
+			ifconfig ${ifname} destroy
 		done
 	fi
 }


More information about the svn-src-all mailing list