Index: etc/defaults/rc.conf
===================================================================
RCS file: /cvsroot/src/etc/defaults/rc.conf,v
retrieving revision 1.56.2.5
diff -u -r1.56.2.5 rc.conf
--- etc/defaults/rc.conf	15 Jul 2004 19:35:56 -0000	1.56.2.5
+++ etc/defaults/rc.conf	3 Sep 2005 20:22:32 -0000
@@ -74,6 +74,9 @@
 #
 critical_filesystems_local="/var"
 critical_filesystems_remote="/usr"
+umount_nfs=NO		# Dismount NFS mounts on shutdown, before stopping
+			# the network.
+umount_all=NO		# Attempt to dismount all file systems on shutdown.
 
 # Swap device controls.
 #
Index: etc/rc.d/mountall
===================================================================
RCS file: /cvsroot/src/etc/rc.d/mountall,v
retrieving revision 1.3
diff -u -r1.3 mountall
--- etc/rc.d/mountall	13 May 2000 08:45:07 -0000	1.3
+++ etc/rc.d/mountall	3 Sep 2005 20:22:32 -0000
@@ -5,12 +5,26 @@
 
 # PROVIDE: mountall
 # REQUIRE: beforemountlkm
+# KEYWORD: shutdown
 
 . /etc/rc.subr
 
 name="mountall"
 start_cmd="echo 'Mounting all filesystems...'; mount -a"
 stop_cmd="echo 'Unmounting all filesystems...'; umount -a"
+stop_cmd="mountall_stop"
+
+mountall_stop()
+{
+	if checkyesno umount_nfs; then
+		echo "Attempting to dismount all NFS mounts"
+		umount -a -t nfs
+	fi
+	if checkyesno umount_all || [ -n "$rc_force" ]; then
+		echo "Attempting to dismount all file systems"
+		umount -a
+	fi
+}
 
 load_rc_config $name
 run_rc_command "$1"
Index: etc/rc.d/network
===================================================================
RCS file: /cvsroot/src/etc/rc.d/network,v
retrieving revision 1.44.4.2
diff -u -r1.44.4.2 network
--- etc/rc.d/network	5 Jul 2005 21:23:17 -0000	1.44.4.2
+++ etc/rc.d/network	3 Sep 2005 20:22:34 -0000
@@ -6,6 +6,7 @@
 # PROVIDE: network
 # REQUIRE: ipfilter ipsec mountcritlocal root tty sysctl
 # BEFORE:  NETWORKING
+# KEYWORD: shutdown
 
 . /etc/rc.subr
 
@@ -200,7 +201,7 @@
 				while read args; do
 					[ -z "$args" ] && continue
 					case "$args" in
-					"#"*|create)
+					"#"*|-*|create)
 						;;
 					"!"*)
 						eval ${args#*!}
@@ -378,8 +379,19 @@
 		for int in $tmp; do
 			eval args=\$ifconfig_$int
 			if [ -n "$args" ] || [ -f /etc/ifconfig.$int ]; then
-				echo -n " $int"
+				echo " $int"
 				ifconfig $int down
+				if [ -f /etc/ifconfig.$int ]; then
+					while read args; do
+						[ -z "$args" ] && continue
+						case "$args" in
+						"-"*)
+							eval ifconfig $int \
+							    ${args#*-}
+							;;
+						esac
+					done < /etc/ifconfig.$int
+				fi
 				if ifconfig $int destroy 2>/dev/null && \
 				   checkyesno ipfilter; then
 					# resync ipf(4)
