Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 14 Sep 2010 01:10:30 +0000 (UTC)
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r212588 - in user/imp/tbemd: . contrib/top etc etc/defaults etc/rc.d share/man/man5 sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/dev/cxgb sys/dev/fb sys/kern sys/powerpc/powerpc s...
Message-ID:  <201009140110.o8E1AUxk050293@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: imp
Date: Tue Sep 14 01:10:30 2010
New Revision: 212588
URL: http://svn.freebsd.org/changeset/base/212588

Log:
  merge from head @r212587

Modified:
  user/imp/tbemd/UPDATING
  user/imp/tbemd/etc/defaults/rc.conf
  user/imp/tbemd/etc/network.subr
  user/imp/tbemd/etc/rc.d/ip6addrctl
  user/imp/tbemd/etc/rc.d/netif
  user/imp/tbemd/share/man/man5/rc.conf.5
  user/imp/tbemd/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
  user/imp/tbemd/sys/dev/cxgb/cxgb_sge.c
  user/imp/tbemd/sys/dev/fb/vesa.c
  user/imp/tbemd/sys/kern/kern_malloc.c
  user/imp/tbemd/sys/kern/kern_sysctl.c
  user/imp/tbemd/sys/kern/subr_lock.c
  user/imp/tbemd/sys/kern/subr_sbuf.c
  user/imp/tbemd/sys/kern/subr_sleepqueue.c
  user/imp/tbemd/sys/kern/subr_witness.c
  user/imp/tbemd/sys/powerpc/powerpc/exec_machdep.c
  user/imp/tbemd/sys/sys/param.h
  user/imp/tbemd/sys/sys/sysctl.h
  user/imp/tbemd/sys/vm/uma_core.c
  user/imp/tbemd/sys/vm/vm_phys.c
  user/imp/tbemd/sys/vm/vm_reserv.c
  user/imp/tbemd/usr.sbin/config/config.y
Directory Properties:
  user/imp/tbemd/   (props changed)
  user/imp/tbemd/cddl/contrib/opensolaris/   (props changed)
  user/imp/tbemd/contrib/bind9/   (props changed)
  user/imp/tbemd/contrib/ee/   (props changed)
  user/imp/tbemd/contrib/expat/   (props changed)
  user/imp/tbemd/contrib/file/   (props changed)
  user/imp/tbemd/contrib/gdb/   (props changed)
  user/imp/tbemd/contrib/gdtoa/   (props changed)
  user/imp/tbemd/contrib/gnu-sort/   (props changed)
  user/imp/tbemd/contrib/groff/   (props changed)
  user/imp/tbemd/contrib/less/   (props changed)
  user/imp/tbemd/contrib/libpcap/   (props changed)
  user/imp/tbemd/contrib/llvm/   (props changed)
  user/imp/tbemd/contrib/llvm/tools/clang/   (props changed)
  user/imp/tbemd/contrib/ncurses/   (props changed)
  user/imp/tbemd/contrib/netcat/   (props changed)
  user/imp/tbemd/contrib/ntp/   (props changed)
  user/imp/tbemd/contrib/one-true-awk/   (props changed)
  user/imp/tbemd/contrib/openbsm/   (props changed)
  user/imp/tbemd/contrib/openpam/   (props changed)
  user/imp/tbemd/contrib/pf/   (props changed)
  user/imp/tbemd/contrib/sendmail/   (props changed)
  user/imp/tbemd/contrib/tcpdump/   (props changed)
  user/imp/tbemd/contrib/tcsh/   (props changed)
  user/imp/tbemd/contrib/top/   (props changed)
  user/imp/tbemd/contrib/top/install-sh   (props changed)
  user/imp/tbemd/contrib/tzcode/stdtime/   (props changed)
  user/imp/tbemd/contrib/tzcode/zic/   (props changed)
  user/imp/tbemd/contrib/tzdata/   (props changed)
  user/imp/tbemd/contrib/wpa/   (props changed)
  user/imp/tbemd/crypto/openssh/   (props changed)
  user/imp/tbemd/crypto/openssl/   (props changed)
  user/imp/tbemd/lib/libc/   (props changed)
  user/imp/tbemd/lib/libc/stdtime/   (props changed)
  user/imp/tbemd/lib/libutil/   (props changed)
  user/imp/tbemd/lib/libz/   (props changed)
  user/imp/tbemd/sbin/   (props changed)
  user/imp/tbemd/sbin/ipfw/   (props changed)
  user/imp/tbemd/share/zoneinfo/   (props changed)
  user/imp/tbemd/sys/   (props changed)
  user/imp/tbemd/sys/amd64/include/xen/   (props changed)
  user/imp/tbemd/sys/cddl/contrib/opensolaris/   (props changed)
  user/imp/tbemd/sys/contrib/dev/acpica/   (props changed)
  user/imp/tbemd/sys/contrib/pf/   (props changed)
  user/imp/tbemd/sys/contrib/x86emu/   (props changed)
  user/imp/tbemd/sys/dev/xen/xenpci/   (props changed)
  user/imp/tbemd/usr.bin/calendar/   (props changed)
  user/imp/tbemd/usr.bin/csup/   (props changed)
  user/imp/tbemd/usr.bin/procstat/   (props changed)
  user/imp/tbemd/usr.sbin/zic/   (props changed)

Modified: user/imp/tbemd/UPDATING
==============================================================================
--- user/imp/tbemd/UPDATING	Tue Sep 14 00:32:29 2010	(r212587)
+++ user/imp/tbemd/UPDATING	Tue Sep 14 01:10:30 2010	(r212588)
@@ -22,6 +22,35 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 9.
 	machines to maximize performance.  (To disable malloc debugging, run
 	ln -s aj /etc/malloc.conf.)
 
+20100913:
+	The $ipv6_prefer variable in rc.conf(5) has been split into
+	$ip6addrctl_policy and $ipv6_activate_all_interfaces.
+
+	The $ip6addrctl_policy is a variable to choose a pre-defined
+	address selection policy set by ip6addrctl(8).  A value
+	"ipv4_prefer", "ipv6_prefer" or "AUTO" can be specified.  The
+	default is "AUTO".
+
+	The $ipv6_activate_all_interfaces specifies whether IFDISABLED
+	flag (see an entry of 20090926) is set on an interface with no
+	corresponding $ifconfig_IF_ipv6 line.  The default is "NO" for
+	security reason.  If you want IPv6 link-local address on all
+	interfaces by default, set this to "YES".
+
+	The old ipv6_prefer="YES" is equivalent to
+	ipv6_activate_all_interfaces="YES" and
+	ip6addrctl_policy="ipv6_prefer".
+
+20100913:
+	DTrace has grown support for userland tracing. Due to this, DTrace is
+	now i386 and amd64 only.
+	dtruss(1) is now installed by default on those systems and a new
+	kernel module is needed for userland tracing: fasttrap.
+	No changes to your kernel config file are necessary to enable
+	userland tracing, but you might consider adding 'STRIP=' and
+	'CFLAGS+=-fno-omit-frame-pointer' to your make.conf if you want
+	to have informative userland stack traces in DTrace (ustack).
+
 20100725:
 	The acpi_aiboost(4) driver has been removed in favor of the new
 	aibs(4) driver. You should update your kernel configuration file.

Modified: user/imp/tbemd/etc/defaults/rc.conf
==============================================================================
--- user/imp/tbemd/etc/defaults/rc.conf	Tue Sep 14 00:32:29 2010	(r212587)
+++ user/imp/tbemd/etc/defaults/rc.conf	Tue Sep 14 01:10:30 2010	(r212588)
@@ -210,8 +210,6 @@ cloned_interfaces=""		# List of cloned n
 ifconfig_lo0="inet 127.0.0.1"	# default loopback device configuration.
 #ifconfig_lo0_alias0="inet 127.0.0.254 netmask 0xffffffff" # Sample alias entry.
 #ifconfig_ed0_ipx="ipx 0x00010010"	# Sample IPX address family entry.
-#ifconfig_ed0_ipv6="RTADV" 	# Sample IPv6 entry for RA/rtsol(8)
-#ifconfig_ed0_ipv6="inet6 auto_linklocal" 	# To configure only link-local
 #ifconfig_ed0_ipv6="inet6 2001:db8:1::1 prefixlen 64" # Sample IPv6 addr entry
 #ifconfig_ed0_alias0="inet6 2001:db8:2::1 prefixlen 64" # Sample IPv6 alias
 #ifconfig_fxp0_name="net0"	# Change interface name from fxp0 to net0.
@@ -446,9 +444,12 @@ ubthidhci_enable="NO"		# Switch an USB B
 icmp_bmcastecho="NO"	# respond to broadcast ping packets
 
 ### IPv6 options: ###
-ipv6_network_interfaces="AUTO"	# List of IPv6 network interfaces
-ipv6_prefer="YES" 		# Use IPv6 when both IPv4 and IPv6 can be used
-ipv6_privacy="NO" 		# Use privacy addresses with RTADV (RFC 4193)
+ipv6_network_interfaces="auto"	# List of IPv6 network interfaces
+				# (or "auto" or "none").
+ipv6_activate_all_interfaces="NO"	# If NO, interfaces which have no
+					# corresponding $ifconfig_IF_ipv6 is
+					# marked as IFDISABLED for security
+					# reason.
 ipv6_defaultrouter="NO"		# Set to IPv6 default gateway (or NO).
 #ipv6_defaultrouter="2002:c058:6301::"	# Use this for 6to4 (RFC 3068)
 ipv6_static_routes=""		# Set to static route list (or leave empty).
@@ -456,6 +457,8 @@ ipv6_static_routes=""		# Set to static r
 				#  route toward loopback interface.
 #ipv6_route_xxx="fec0:0000:0000:0006:: -prefixlen 64 ::1"
 ipv6_gateway_enable="NO"	# Set to YES if this host will be a gateway.
+ipv6_privacy="NO"		# Use privacy address on RA-receiving IFs
+				# (RFC 4193)
 
 route6d_enable="NO"		# Set to YES to enable an IPv6 routing daemon.
 route6d_program="/usr/sbin/route6d"	# Name of IPv6 routing daemon.
@@ -507,6 +510,8 @@ ipv6_ipfilter_rules="/etc/ipf6.rules"	# 
 					# for examples
 ip6addrctl_enable="YES"	# Set to YES to enable default address selection
 ip6addrctl_verbose="NO"	# Set to YES to enable verbose configuration messages
+ip6addrctl_policy="AUTO"	# A pre-defined address selection policy
+				# (ipv4_prefer, ipv6_prefer, or AUTO)
 
 ##############################################################
 ###  System console options  #################################

Modified: user/imp/tbemd/etc/network.subr
==============================================================================
--- user/imp/tbemd/etc/network.subr	Tue Sep 14 00:32:29 2010	(r212587)
+++ user/imp/tbemd/etc/network.subr	Tue Sep 14 01:10:30 2010	(r212588)
@@ -96,32 +96,44 @@ ifconfig_up()
 	# inet6 specific
 	if afexists inet6; then
 		if ipv6if $1; then
-			# Implicitly handles ipv6_gateway_enable
-			_ipv6_opts='-ifdisabled -accept_rtadv'
-
-			if ipv6_autoconfif $1; then
-				_ipv6_opts='-ifdisabled accept_rtadv'
-			fi
-
-			ifconfig $1 inet6 $_ipv6_opts
-
-			# ifconfig_IF_ipv6
-			ifconfig_args=`ifconfig_getargs $1 ipv6`
-
-			if [ -n "$ifconfig_args" ]; then
-				ifconfig $1 $ifconfig_args
-				_cfg=0
+			if checkyesno ipv6_gateway_enable; then
+				_ipv6_opts="-accept_rtadv"
 			fi
 		else
-		# Remove in FreeBSD 10.x
-		# Explicit test is necessary here to avoid nonexistence error
-			case "$ipv6_enable" in
+			if checkyesno ipv6_activate_all_interfaces; then
+				_ipv6_opts="-ifdisabled"
+			else
+				_ipv6_opts="ifdisabled"
+			fi
+
+			# backward compatibility: $ipv6_enable
+			case $ipv6_enable in
 			[Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1)
-			warn "Interface $1 will NOT be configured for IPv6"
+				_ipv6_opts="${_ipv6_opts} accept_rtadv"
 				;;
 			esac
+		fi
 
-			ifconfig $1 inet6 ifdisabled
+		if [ -n "${_ipv6_opts}" ]; then
+			ifconfig $1 inet6 ${_ipv6_opts}
+		fi
+
+		# ifconfig_IF_ipv6
+		ifconfig_args=`ifconfig_getargs $1 ipv6`
+		if [ -n "${ifconfig_args}" ]; then
+			ifconfig $1 inet6 -ifdisabled
+			ifconfig $1 ${ifconfig_args}
+			_cfg=0
+		fi
+
+		# backward compatiblity: $ipv6_ifconfig_IF
+		ifconfig_args=`get_if_var $1 ipv6_ifconfig_IF`
+		if [ -n "${ifconfig_args}" ]; then
+			warn "\$ipv6_ifconfig_$1 is obsolete." \
+			    "  Use ifconfig_$1_ipv6 instead."
+			ifconfig $1 inet6 -ifdisabled
+			ifconfig $1 inet6 ${ifconfig_args}
+			_cfg=0
 		fi
 	fi
 
@@ -207,7 +219,7 @@ get_if_var()
 #	outside this file.
 _ifconfig_getargs()
 {
-	local _ifn _af value
+	local _ifn _af
 	_ifn=$1
 	_af=${2+_$2}
 
@@ -215,18 +227,7 @@ _ifconfig_getargs()
 		return 1
 	fi
 
-	value=`get_if_var $_ifn ifconfig_IF$_af "$ifconfig_DEFAULT"`
-
-	# Remove in FreeBSD 10.x
-	if [ "$_af" = _ipv6 -a -z "$value" ]; then
-		value=`get_if_var $_ifn ipv6_ifconfig_IF "$ifconfig_DEFAULT"`
-		if [ -n "$value" ]; then
-			warn "\$ipv6_ifconfig_$1 is obsolete." \
-			"  Use ifconfig_$1_ipv6 instead."
-		fi
-	fi
-
-	echo $value
+	get_if_var $_ifn ifconfig_IF$_af "$ifconfig_DEFAULT"
 }
 
 # ifconfig_getargs if [af]
@@ -248,8 +249,6 @@ ifconfig_getargs()
 		[Nn][Oo][Ss][Yy][Nn][Cc][Dd][Hh][Cc][Pp]) ;;
 		[Ss][Yy][Nn][Cc][Dd][Hh][Cc][Pp]) ;;
 		[Ww][Pp][Aa]) ;;
-		[Rr][Tt][Aa][Dd][Vv]) ;;
-		[Nn][Oo][Rr][Tt][Aa][Dd][Vv]) ;;
 		*)
 			_args="$_args $_arg"
 			;;
@@ -373,48 +372,68 @@ afexists()
 	esac
 }
 
+# noafif if
+#	Returns 0 if the interface has no af configuration and 1 otherwise.
+noafif()
+{
+	local _if
+	_if=$1
+
+	case $_if in
+	pflog[0-9]*|\
+	pfsync[0-9]*|\
+	an[0-9]*|\
+	ath[0-9]*|\
+	ipw[0-9]*|\
+	ipfw[0-9]*|\
+	iwi[0-9]*|\
+	iwn[0-9]*|\
+	ral[0-9]*|\
+	wi[0-9]*|\
+	wl[0-9]*|\
+	wpi[0-9]*)
+		return 0
+		;;
+	esac
+
+	return 1
+}
+
 # ipv6if if
 #	Returns 0 if the interface should be configured for IPv6 and
 #	1 otherwise.
 ipv6if()
 {
+	local _if _tmpargs i
+	_if=$1
+
 	if ! afexists inet6; then
 		return 1
 	fi
 
 	# lo0 is always IPv6-enabled
-	case $1 in
+	case $_if in
 	lo0)
 		return 0
 		;;
 	esac
 
-	local _if _tmpargs i
-	_if=$1
-
-	case "$ipv6_network_interfaces" in
-	''|[Nn][Oo][Nn][Ee])
-		return 1
-		;;
+	case "${ipv6_network_interfaces}" in
 	$_if|"$_if "*|*" $_if"|*" $_if "*|[Aa][Uu][Tt][Oo])
 		# True if $ifconfig_IF_ipv6 is defined.
 		_tmpargs=`_ifconfig_getargs $_if ipv6`
-		# Also true if ipv6_prefix_IF is defined
-		[ -n "$_tmpargs" ] || _tmpargs=`get_if_var $_if ipv6_prefix_IF`
+		if [ -n "${_tmpargs}" ]; then
+			return 0
+		fi
+
+		# backward compatibility: True if $ipv6_ifconfig_IF is defined.
+		_tmpargs=`get_if_var $_if ipv6_ifconfig_IF`
+		if [ -n "${_tmpargs}" ]; then
+			return 0
+		fi
 		;;
 	esac
 
-	if [ -n "$_tmpargs" ]; then
-		# Remove in FreeBSD 10.x
-		# Explicit test is necessary here to avoid nonexistence error
-		case "$ipv6_enable" in
-		[Nn][Oo]|[Ff][Aa][Ll][Ss][Ee]|[Oo][Ff][Ff]|0)
-			;;
-		*)	return 0
-			;;
-		esac
-	fi
-
 	return 1
 }
 
@@ -423,21 +442,21 @@ ipv6if()
 #	Stateless Address Configuration, 1 otherwise.
 ipv6_autoconfif()
 {
-	case $1 in
+	local _if _tmpargs _arg
+	_if=$1
+
+	case $_if in
 	lo0|\
 	stf[0-9]*|\
 	faith[0-9]*|\
 	lp[0-9]*|\
-	sl[0-9]*|\
-	pflog[0-9]*|\
-	pfsync[0-9]*)
+	sl[0-9]*)
 		return 1
 		;;
 	esac
-
-	local _if _tmpargs _arg
-	_if=$1
-
+	if noafif $_if; then
+		return 1
+	fi
 	if ! ipv6if $_if; then
 		return 1
 	fi
@@ -448,23 +467,31 @@ ipv6_autoconfif()
 	if [ -n "${_tmpargs}" ]; then
 		return 1
 	fi
-	if ! is_wired_interface $_if; then
-		case $_if in
-		wlan[0-9]*)	;;	# Allow test to continue
-		*)	return 1
+	# backward compatibility: $ipv6_enable
+	case $ipv6_enable in
+	[Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1)
+		return 0
+	;;
+	esac
+
+	_tmpargs=`_ifconfig_getargs $_if ipv6`
+	for _arg in $_tmpargs; do
+		case $_arg in
+		accept_rtadv)
+			return 0
 			;;
 		esac
-	fi
+	done
 
-	_tmpargs=`_ifconfig_getargs $_if ipv6`
-	case "$_tmpargs" in
-	*inet6\ *|*[Nn][Oo][Rr][Tt][Aa][Dd][Vv]*|*-accept_rtadv*)
-		return 1
-		;;
-	*[Rr][Tt][Aa][Dd][Vv]*|*accept_rtadv*)
-		return 0
-		;;
-	esac
+	# backward compatibility: $ipv6_ifconfig_IF
+	_tmpargs=`get_if_var $_if ipv6_ifconfig_IF`
+	for _arg in $_tmpargs; do
+		case $_arg in
+		accept_rtadv)
+			return 0
+			;;
+		esac
+	done
 
 	return 1
 }

Modified: user/imp/tbemd/etc/rc.d/ip6addrctl
==============================================================================
--- user/imp/tbemd/etc/rc.d/ip6addrctl	Tue Sep 14 00:32:29 2010	(r212587)
+++ user/imp/tbemd/etc/rc.d/ip6addrctl	Tue Sep 14 01:10:30 2010	(r212588)
@@ -19,6 +19,10 @@ extra_commands="status prefer_ipv6 prefe
 status_cmd="ip6addrctl"
 prefer_ipv6_cmd="ip6addrctl_prefer_ipv6"
 prefer_ipv4_cmd="ip6addrctl_prefer_ipv4"
+config_file="/etc/ip6addrctl.conf"
+
+set_rcvar_obsolete ipv6_enable ipv6_activate_all_interfaces
+set_rcvar_obsolete ipv6_prefer ip6addrctl_policy
 
 ip6addrctl_prefer_ipv6()
 {
@@ -51,17 +55,40 @@ ip6addrctl_start()
 	afexists inet6 || return 0
 
 	# install the policy of the address selection algorithm.
-	if [ -f /etc/ip6addrctl.conf ]; then
-		ip6addrctl flush >/dev/null 2>&1
-		ip6addrctl install /etc/ip6addrctl.conf
-		checkyesno ip6addrctl_verbose && ip6addrctl
-	else
-		if checkyesno ipv6_prefer; then
-			ip6addrctl_prefer_ipv6
+	case "${ip6addrctl_policy}" in
+	[Aa][Uu][Tt][Oo])
+		if [ -r "${config_file}" -a -s "${config_file}" ]; then
+			ip6addrctl flush >/dev/null 2>&1
+			ip6addrctl install "${config_file}"
+			checkyesno ip6addrctl_verbose && ip6addrctl
 		else
-			ip6addrctl_prefer_ipv4
+			if checkyesno ipv6_activate_all_interfaces; then
+				ip6addrctl_prefer_ipv6
+			else
+				ip6addrctl_prefer_ipv4
+			fi
 		fi
-	fi
+	;;
+	ipv4_prefer)
+		ip6addrctl_prefer_ipv4
+	;;
+	ipv6_prefer)
+		ip6addrctl_prefer_ipv6
+	;;
+	[Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1)
+		# Backward compatibility when ipv6_prefer=YES
+		ip6addrctl_prefer_ipv6
+	;;
+	[Nn][Oo]|[Ff][Aa][Ll][Ss][Ee]|[Oo][Ff][Ff]|0)
+		# Backward compatibility when ipv6_prefer=NO
+		ip6addrctl_prefer_ipv4
+	;;
+	*)
+		warn "\$ip6addrctl_policy is invalid: ${ip6addrctl_policy}. " \
+		    " \"ipv4_prefer\" is used instead."
+		ip6addrctl_prefer_ipv4
+	;;
+	esac
 }
 
 ip6addrctl_stop()

Modified: user/imp/tbemd/etc/rc.d/netif
==============================================================================
--- user/imp/tbemd/etc/rc.d/netif	Tue Sep 14 00:32:29 2010	(r212587)
+++ user/imp/tbemd/etc/rc.d/netif	Tue Sep 14 01:10:30 2010	(r212588)
@@ -34,7 +34,6 @@
 . /etc/network.subr
 
 name="network"
-start_precmd="network_prestart"
 start_cmd="network_start"
 stop_cmd="network_stop"
 cloneup_cmd="clone_up"
@@ -42,13 +41,8 @@ clonedown_cmd="clone_down"
 extra_commands="cloneup clonedown"
 cmdifn=
 
-network_prestart()
-{
-	if [ -n "$ipv6_enable" ]; then
-		warn 'The ipv6_enable option is deprecated.'
-		warn 'See rc.conf(5) for information on disabling IPv6.'
-	fi
-}
+set_rcvar_obsolete ipv6_enable ipv6_activate_all_interfaces
+set_rcvar_obsolete ipv6_prefer
 
 network_start()
 {

Modified: user/imp/tbemd/share/man/man5/rc.conf.5
==============================================================================
--- user/imp/tbemd/share/man/man5/rc.conf.5	Tue Sep 14 00:32:29 2010	(r212587)
+++ user/imp/tbemd/share/man/man5/rc.conf.5	Tue Sep 14 01:10:30 2010	(r212588)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd September 4, 2010
+.Dd September 13, 2010
 .Dt RC.CONF 5
 .Os
 .Sh NAME
@@ -1261,105 +1261,95 @@ It is also possible to rename an interfa
 ifconfig_ed0_name="net0"
 ifconfig_net0="inet 192.0.2.1 netmask 0xffffff00"
 .Ed
-.\" Remove in FreeBSD 10.x
 .It Va ipv6_enable
 .Pq Vt bool
-.Pp
-This option is deprecated.
-.Pp
-If the variable is
-.Dq Li YES
-it has no effect.
-To configure IPv6 for an interface see
-.Va ipv6_network_interfaces
-below.
-.Pp
 If the variable is
-.Dq Li NO
-then other than
-.Dq Li lo0
-IPv6 will be disabled for each interface,
-however the same effect can be achieved by
-not configuring the interface.
-.It Va ipv6_network_interfaces
-.Pq Vt str
-This is the IPv6 equivalent of
-.Va network_interfaces .
-Normally configuration of this variable is not needed,
-the value should be left as
-.Dq Li AUTO .
-.Pp
-If
-.Dq Li INET6
-is configured in the kernel configuration for the
-.Dq Li lo0
-interface will always be performed.
-It is not necessary to list it in
-.Va ipv6_network_interfaces .
-.Pp
-Example configuration to accept Router Advertisements (RA) for the
-.Dq Li ed0
-interface:
-.Bd -literal
-ifconfig_ed0_ipv6="RTADV"
-.Ed
-.Pp
-To configure only a link-local address on the
-.Dq Li ed0
-interface:
-.Bd -literal
-ifconfig_ed0_ipv6="inet6 auto_linklocal"
-.Ed
-.Pp
-To disable RA the
-.Dq Li NORTADV
-option is available, although not required if manual
-configuration is performed as described below.
-.Pp
-An IPv6 interface can be configured manually with
-.Va ifconfig_ Ns Ao Ar interface Ac Ns _ipv6 .
-For example:
-.Bd -literal
-ifconfig_ed0_ipv6="inet6 2001:db8:1::1 prefixlen 64"
-.Ed
-.Pp
-Manual configuration of an IPv6 address will also
-require configuration of the
-.Va ipv6_defaultrouter
-option.
-.Pp
-Aliases should be set by
-.Va ifconfig_ Ns Ao Ar interface Ac Ns Va _alias Ns Aq Ar n
-with the
-.Dq Li inet6
-keyword.
-For example:
-.Pp
-.Bd -literal
-ifconfig_ed0_alias0="inet6 2001:db8:2::1 prefixlen 64"
-.Ed
+.Dq Li YES ,
+.Dq Li inet6 accept_rtadv
+is added to all of
+.Va ifconfig_ Ns Ao Ar interface Ac Ns _ipv6
+and the
+.Va ipv6_activate_all_interfaces
+is defined as
+.Dq Li YES .
 .Pp
+This variable is deprecated.  Use
+.Va ifconfig_ Ns Ao Ar interface Ac Ns _ipv6
+and
+.Va ipv6_activate_all_interfaces
+if necessary.
 .It Va ipv6_prefer
 .Pq Vt bool
 If the variable is
 .Dq Li YES ,
-the default policy of the source address selection set by
+the default address selection policy table set by
 .Xr ip6addrctl 8
 will be IPv6-preferred.
 .Pp
 If the variable is
 .Dq Li NO ,
-the default policy of the source address selection set by
+the default address selection policy table set by
 .Xr ip6addrctl 8
 will be IPv4-preferred.
 .Pp
+This variable is deprecated.  Use
+.Va ip6addtctl_policy
+instead.
+.It Va ipv6_activate_all_interfaces
+If the variable is
+.Dq Li NO ,
+all of interfaces which do not have the corrsponding
+.Va ifconfig_ Ns Ao Ar interface Ac Ns _ipv6
+variable will be marked as
+.Dq Li IFDISABLED
+for security reason.  This means only IPv6 functionality on that interface
+is completely disabled.  For more details of
+.Dq Li IFDISABLED
+flag and keywords
+.Dq Li inet6 ifdisabled ,
+see
+.Xr ifconfig 8 .
+.Pp
+Default is
+.Dq Li NO .
 .It Va ipv6_privacy
 .Pq Vt bool
 If the variable is
 .Dq Li YES
 privacy addresses will be generated for each IPv6
 interface as described in RFC 4193.
+.It Va ipv6_network_interfaces
+.Pq Vt str
+This is the IPv6 equivalent of
+.Va network_interfaces .
+Normally manual configuration of this variable is not needed.
+.Pp
+.It Va ifconfig_ Ns Ao Ar interface Ac Ns _ipv6
+.Pq Vt str
+IPv6 functionality on an interface should be configured by
+.Va ifconfig_ Ns Ao Ar interface Ac Ns _ipv6 ,
+instead of setting ifconfig parameters in
+.Va ifconfig_ Ns Aq Ar interface .
+Aliases should be set by
+.Va ifconfig_ Ns Ao Ar interface Ac Ns Va _alias Ns Aq Ar n
+with
+.Dq Li inet6
+keyword.  For example:
+.Bd -literal
+ifconfig_ed0_ipv6="inet6 2001:db8:1::1 prefixlen 64"
+ifconfig_ed0_alias0="inet6 2001:db8:2::1 prefixlen 64"
+.Ed
 .Pp
+Interfaces that have an
+.Dq Li inet6 accept_rtadv
+keyword in
+.Va ifconfig_ Ns Ao Ar interface Ac Ns _ipv6
+setting will be automatically configured by
+.Xr rtsol 8 .
+Note that this automatic configuration is disabled if the
+.Va ipv6_gateway_enable
+is set to
+.Dq Li YES .
 .It Va ipv6_prefix_ Ns Aq Ar interface
 .Pq Vt str
 If one or more prefixes are defined in
@@ -1374,22 +1364,52 @@ this is the default output interface for
 This works only with ipv6_gateway_enable="NO".
 .It Va ip6addrctl_enable
 .Pq Vt bool
-If set to
-.Dq Li YES ,
-install default address selection policy table
+This variable is to enable configuring default address selection policy table
 .Pq RFC 3484 .
-If a file
+The table can be specified in another variable
+.Va ip6addrctl_policy .
+For
+.Va ip6addrctl_policy
+the following keywords can be specified:
+.Dq Li ipv4_prefer ,
+.Dq Li ipv6_prefer ,
+or
+.Dq Li AUTO .
+.Pp
+If
+.Dq Li ipv4_prefer
+or
+.Dq Li ipv6_prefer
+is specified,
+.Xr ip6addrctl 8
+installs a pre-defined policy table described in Section 2.1
+.Pq IPv6-preferred
+or 10.3
+.Pq IPv4-preferred
+of RFC 3484.
+.Pp
+If
+.Dq Li AUTO
+is specified, it attempts to read a file
 .Pa /etc/ip6addrctl.conf
-is found the
+first.  If this file is found,
 .Xr ip6addrctl 8
-reads and installs it.
-If not, a pre-defined policy table will be installed.
-There are two pre-defined ones; IPv4-preferred and IPv6-preferred.
-If set
-.Va ipv6_prefer
-variable to
+reads and installs it.  If not found, a policy is automatically set
+according to
+.Va ipv6_activate_all_interfaces
+variable; if the variable is set to
 .Dq Li YES
-the IPv6-preferred one is used. Default is IPv4-preferred.
+the IPv6-preferred one is used.  Otherwise IPv4-preferred.
+.Pp
+The default value of
+.Va ip6addrctl_enable
+and
+.Va ip6addrctl_policy
+are
+.Dq Li YES
+and
+.Dq Li AUTO ,
+respectively.
 .It Va cloned_interfaces
 .Pq Vt str
 Set to the list of clonable network interfaces to create on this host.

Modified: user/imp/tbemd/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
==============================================================================
--- user/imp/tbemd/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c	Tue Sep 14 00:32:29 2010	(r212587)
+++ user/imp/tbemd/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c	Tue Sep 14 01:10:30 2010	(r212588)
@@ -326,9 +326,7 @@ page_lookup(vnode_t *vp, int64_t start, 
 			if (vm_page_sleep_if_busy(pp, FALSE, "zfsmwb"))
 				continue;
 			vm_page_busy(pp);
-			vm_page_lock_queues();
 			vm_page_undirty(pp);
-			vm_page_unlock_queues();
 		} else {
 			if (__predict_false(obj->cache != NULL)) {
 				vm_page_cache_free(obj, OFF_TO_IDX(start),

Modified: user/imp/tbemd/sys/dev/cxgb/cxgb_sge.c
==============================================================================
--- user/imp/tbemd/sys/dev/cxgb/cxgb_sge.c	Tue Sep 14 00:32:29 2010	(r212587)
+++ user/imp/tbemd/sys/dev/cxgb/cxgb_sge.c	Tue Sep 14 01:10:30 2010	(r212588)
@@ -3227,6 +3227,7 @@ t3_dump_rspq(SYSCTL_HANDLER_ARGS)
 	struct sge_rspq *rspq;
 	struct sge_qset *qs;
 	int i, err, dump_end, idx;
+	static int multiplier = 1;
 	struct sbuf *sb;
 	struct rsp_desc *rspd;
 	uint32_t data[4];
@@ -3251,8 +3252,8 @@ t3_dump_rspq(SYSCTL_HANDLER_ARGS)
 	err = t3_sge_read_rspq(qs->port->adapter, rspq->cntxt_id, data);
 	if (err)
 		return (err);
-
-	sb = sbuf_new_for_sysctl(NULL, NULL, QDUMP_SBUF_SIZE, req);
+retry_sbufops:
+	sb = sbuf_new(NULL, NULL, QDUMP_SBUF_SIZE*multiplier, SBUF_FIXEDLEN);
 
 	sbuf_printf(sb, " \n index=%u size=%u MSI-X/RspQ=%u intr enable=%u intr armed=%u\n",
 	    (data[0] & 0xffff), data[0] >> 16, ((data[2] >> 20) & 0x3f),
@@ -3275,11 +3276,13 @@ t3_dump_rspq(SYSCTL_HANDLER_ARGS)
 		    rspd->rss_hdr.rss_hash_val, be32toh(rspd->flags),
 		    be32toh(rspd->len_cq), rspd->intr_gen);
 	}
-
-	err = sbuf_finish(sb);
-	/* Output a trailing NUL. */
-	if (err == 0)
-		err = SYSCTL_OUT(req, "", 1);
+	if (sbuf_error(sb) != 0) {
+		sbuf_delete(sb);
+		multiplier++;
+		goto retry_sbufops;
+	}
+	sbuf_finish(sb);
+	err = SYSCTL_OUT(req, sbuf_data(sb), sbuf_len(sb) + 1);
 	sbuf_delete(sb);
 	return (err);
 }	
@@ -3290,6 +3293,7 @@ t3_dump_txq_eth(SYSCTL_HANDLER_ARGS)
 	struct sge_txq *txq;
 	struct sge_qset *qs;
 	int i, j, err, dump_end;
+	static int multiplier = 1;
 	struct sbuf *sb;
 	struct tx_desc *txd;
 	uint32_t *WR, wr_hi, wr_lo, gen;
@@ -3317,7 +3321,9 @@ t3_dump_txq_eth(SYSCTL_HANDLER_ARGS)
 	if (err)
 		return (err);
 	
-	sb = sbuf_new_for_sysctl(NULL, NULL, QDUMP_SBUF_SIZE, req);
+	    
+retry_sbufops:
+	sb = sbuf_new(NULL, NULL, QDUMP_SBUF_SIZE*multiplier, SBUF_FIXEDLEN);
 
 	sbuf_printf(sb, " \n credits=%u GTS=%u index=%u size=%u rspq#=%u cmdq#=%u\n",
 	    (data[0] & 0x7fff), ((data[0] >> 15) & 1), (data[0] >> 16), 
@@ -3344,10 +3350,13 @@ t3_dump_txq_eth(SYSCTL_HANDLER_ARGS)
 			    WR[j], WR[j + 1], WR[j + 2], WR[j + 3]);
 
 	}
-	err = sbuf_finish(sb);
-	/* Output a trailing NUL. */
-	if (err == 0)
-		err = SYSCTL_OUT(req, "", 1);
+	if (sbuf_error(sb) != 0) {
+		sbuf_delete(sb);
+		multiplier++;
+		goto retry_sbufops;
+	}
+	sbuf_finish(sb);
+	err = SYSCTL_OUT(req, sbuf_data(sb), sbuf_len(sb) + 1);
 	sbuf_delete(sb);
 	return (err);
 }
@@ -3358,6 +3367,7 @@ t3_dump_txq_ctrl(SYSCTL_HANDLER_ARGS)
 	struct sge_txq *txq;
 	struct sge_qset *qs;
 	int i, j, err, dump_end;
+	static int multiplier = 1;
 	struct sbuf *sb;
 	struct tx_desc *txd;
 	uint32_t *WR, wr_hi, wr_lo, gen;
@@ -3381,7 +3391,8 @@ t3_dump_txq_ctrl(SYSCTL_HANDLER_ARGS)
 		return (EINVAL);
 	}
 
-	sb = sbuf_new_for_sysctl(NULL, NULL, QDUMP_SBUF_SIZE, req);
+retry_sbufops:
+	sb = sbuf_new(NULL, NULL, QDUMP_SBUF_SIZE*multiplier, SBUF_FIXEDLEN);
 	sbuf_printf(sb, " qid=%d start=%d -> end=%d\n", qs->idx,
 	    txq->txq_dump_start,
 	    (txq->txq_dump_start + txq->txq_dump_count) & 255);
@@ -3401,10 +3412,13 @@ t3_dump_txq_ctrl(SYSCTL_HANDLER_ARGS)
 			    WR[j], WR[j + 1], WR[j + 2], WR[j + 3]);
 
 	}
-	err = sbuf_finish(sb);
-	/* Output a trailing NUL. */
-	if (err == 0)
-		err = SYSCTL_OUT(req, "", 1);
+	if (sbuf_error(sb) != 0) {
+		sbuf_delete(sb);
+		multiplier++;
+		goto retry_sbufops;
+	}
+	sbuf_finish(sb);
+	err = SYSCTL_OUT(req, sbuf_data(sb), sbuf_len(sb) + 1);
 	sbuf_delete(sb);
 	return (err);
 }

Modified: user/imp/tbemd/sys/dev/fb/vesa.c
==============================================================================
--- user/imp/tbemd/sys/dev/fb/vesa.c	Tue Sep 14 00:32:29 2010	(r212587)
+++ user/imp/tbemd/sys/dev/fb/vesa.c	Tue Sep 14 01:10:30 2010	(r212588)
@@ -804,18 +804,16 @@ vesa_bios_init(void)
 		vbios = x86bios_get_orm(vesa_bios_offs);
 		if (vbios != NULL) {
 			vesa_bios_size = vbios[2] * 512;
-			offs = BIOS_SADDRTOLADDR(vesa_bios_int10);
-			if (offs > vesa_bios_offs &&
-			    offs < vesa_bios_offs + vesa_bios_size) {
+			if (((VESA_BIOS_OFFSET << 12) & 0xffff0000) ==
+			    (vesa_bios_int10 & 0xffff0000) &&
+			    vesa_bios_size > (vesa_bios_int10 & 0xffff)) {
 				vesa_bios = x86bios_alloc(&vesa_bios_offs,
 				    vesa_bios_size, M_WAITOK);
 				memcpy(vesa_bios, vbios, vesa_bios_size);
-				offs = offs - VESA_BIOS_OFFSET + vesa_bios_offs;
-				offs = (X86BIOS_PHYSTOSEG(offs) << 16) +
-				    X86BIOS_PHYSTOOFF(offs);
+				offs = ((vesa_bios_offs << 12) & 0xffff0000) +
+				    (vesa_bios_int10 & 0xffff);
 				x86bios_set_intr(0x10, offs);
-			} else
-				offs = vesa_bios_int10;
+			}
 		}
 		if (vesa_bios == NULL)
 			printf("VESA: failed to shadow video ROM\n");

Modified: user/imp/tbemd/sys/kern/kern_malloc.c
==============================================================================
--- user/imp/tbemd/sys/kern/kern_malloc.c	Tue Sep 14 00:32:29 2010	(r212587)
+++ user/imp/tbemd/sys/kern/kern_malloc.c	Tue Sep 14 01:10:30 2010	(r212588)
@@ -828,11 +828,25 @@ sysctl_kern_malloc_stats(SYSCTL_HANDLER_
 	struct malloc_type_internal *mtip;
 	struct malloc_type_header mth;
 	struct malloc_type *mtp;
-	int error, i;
+	int buflen, count, error, i;
 	struct sbuf sbuf;
+	char *buffer;
 
-	sbuf_new_for_sysctl(&sbuf, NULL, 128, req);
 	mtx_lock(&malloc_mtx);
+restart:
+	mtx_assert(&malloc_mtx, MA_OWNED);
+	count = kmemcount;
+	mtx_unlock(&malloc_mtx);
+	buflen = sizeof(mtsh) + count * (sizeof(mth) +
+	    sizeof(struct malloc_type_stats) * MAXCPU) + 1;
+	buffer = malloc(buflen, M_TEMP, M_WAITOK | M_ZERO);
+	mtx_lock(&malloc_mtx);
+	if (count < kmemcount) {
+		free(buffer, M_TEMP);
+		goto restart;
+	}
+
+	sbuf_new(&sbuf, buffer, buflen, SBUF_FIXEDLEN);
 
 	/*
 	 * Insert stream header.
@@ -841,7 +855,11 @@ sysctl_kern_malloc_stats(SYSCTL_HANDLER_
 	mtsh.mtsh_version = MALLOC_TYPE_STREAM_VERSION;
 	mtsh.mtsh_maxcpus = MAXCPU;
 	mtsh.mtsh_count = kmemcount;
-	(void)sbuf_bcat(&sbuf, &mtsh, sizeof(mtsh));
+	if (sbuf_bcat(&sbuf, &mtsh, sizeof(mtsh)) < 0) {
+		mtx_unlock(&malloc_mtx);
+		error = ENOMEM;
+		goto out;
+	}
 
 	/*
 	 * Insert alternating sequence of type headers and type statistics.
@@ -854,19 +872,30 @@ sysctl_kern_malloc_stats(SYSCTL_HANDLER_
 		 */
 		bzero(&mth, sizeof(mth));
 		strlcpy(mth.mth_name, mtp->ks_shortdesc, MALLOC_MAX_NAME);
-		(void)sbuf_bcat(&sbuf, &mth, sizeof(mth));
+		if (sbuf_bcat(&sbuf, &mth, sizeof(mth)) < 0) {
+			mtx_unlock(&malloc_mtx);
+			error = ENOMEM;
+			goto out;
+		}
 
 		/*
 		 * Insert type statistics for each CPU.
 		 */
 		for (i = 0; i < MAXCPU; i++) {
-			(void)sbuf_bcat(&sbuf, &mtip->mti_stats[i],
-			    sizeof(mtip->mti_stats[i]));
+			if (sbuf_bcat(&sbuf, &mtip->mti_stats[i],
+			    sizeof(mtip->mti_stats[i])) < 0) {
+				mtx_unlock(&malloc_mtx);
+				error = ENOMEM;
+				goto out;
+			}
 		}
 	}
 	mtx_unlock(&malloc_mtx);
-	error = sbuf_finish(&sbuf);
+	sbuf_finish(&sbuf);
+	error = SYSCTL_OUT(req, sbuf_data(&sbuf), sbuf_len(&sbuf));
+out:
 	sbuf_delete(&sbuf);
+	free(buffer, M_TEMP);
 	return (error);
 }
 
@@ -976,19 +1005,26 @@ DB_SHOW_COMMAND(multizone_matches, db_sh
 static int
 sysctl_kern_mprof(SYSCTL_HANDLER_ARGS)
 {
+	int linesize = 64;
 	struct sbuf sbuf;
 	uint64_t count;
 	uint64_t waste;
 	uint64_t mem;
+	int bufsize;
 	int error;
+	char *buf;
 	int rsize;
 	int size;
 	int i;
 
+	bufsize = linesize * (KMEM_ZSIZE + 1);
+	bufsize += 128; 	/* For the stats line */
+	bufsize += 128; 	/* For the banner line */
 	waste = 0;
 	mem = 0;
 
-	sbuf_new_for_sysctl(&sbuf, NULL, 128, req);
+	buf = malloc(bufsize, M_TEMP, M_WAITOK|M_ZERO);
+	sbuf_new(&sbuf, buf, bufsize, SBUF_FIXEDLEN);
 	sbuf_printf(&sbuf, 
 	    "\n  Size                    Requests  Real Size\n");
 	for (i = 0; i < KMEM_ZSIZE; i++) {
@@ -1006,8 +1042,12 @@ sysctl_kern_mprof(SYSCTL_HANDLER_ARGS)
 	sbuf_printf(&sbuf,
 	    "\nTotal memory used:\t%30llu\nTotal Memory wasted:\t%30llu\n",
 	    (unsigned long long)mem, (unsigned long long)waste);
-	error = sbuf_finish(&sbuf);
+	sbuf_finish(&sbuf);
+
+	error = SYSCTL_OUT(req, sbuf_data(&sbuf), sbuf_len(&sbuf));
+
 	sbuf_delete(&sbuf);
+	free(buf, M_TEMP);
 	return (error);
 }
 

Modified: user/imp/tbemd/sys/kern/kern_sysctl.c
==============================================================================
--- user/imp/tbemd/sys/kern/kern_sysctl.c	Tue Sep 14 00:32:29 2010	(r212587)
+++ user/imp/tbemd/sys/kern/kern_sysctl.c	Tue Sep 14 01:10:30 2010	(r212588)
@@ -51,7 +51,6 @@ __FBSDID("$FreeBSD$");
 #include <sys/jail.h>
 #include <sys/lock.h>
 #include <sys/mutex.h>
-#include <sys/sbuf.h>
 #include <sys/sx.h>
 #include <sys/sysproto.h>
 #include <sys/uio.h>
@@ -1545,30 +1544,3 @@ userland_sysctl(struct thread *td, int *
 	}
 	return (error);
 }
-
-/*
- * Drain into a sysctl struct.  The user buffer must be wired.
- */
-static int
-sbuf_sysctl_drain(void *arg, const char *data, int len)
-{
-	struct sysctl_req *req = arg;
-	int error;
-
-	error = SYSCTL_OUT(req, data, len);
-	KASSERT(error >= 0, ("Got unexpected negative value %d", error));
-	return (error == 0 ? len : -error);
-}
-
-struct sbuf *
-sbuf_new_for_sysctl(struct sbuf *s, char *buf, int length,
-    struct sysctl_req *req)
-{
-
-	/* Wire the user buffer, so we can write without blocking. */
-	sysctl_wire_old_buffer(req, 0);
-

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201009140110.o8E1AUxk050293>