Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 Aug 2009 21:08:41 +0000 (UTC)
From:      Doug Barton <dougb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r196566 - in stable/8/etc: . rc.d
Message-ID:  <200908262108.n7QL8fF7074314@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dougb
Date: Wed Aug 26 21:08:41 2009
New Revision: 196566
URL: http://svn.freebsd.org/changeset/base/196566

Log:
  MFC 196436;
  
  Move is_wired_interface() from rc.d/wpa_supplicant into network.subr,
  simplify it a bit, and make use of that method to determine if an
  interface is a candidate for IPv6 rtsol rather than listing all of the
  possible wireless interfaces that should _not_ get rtsol'ed.
  
  This change is only relevant for 8.0+ unless the "wlan mandatory" code
  gets ported back to RELENG_7.
  
  Approved by:	re (kib)

Modified:
  stable/8/etc/   (props changed)
  stable/8/etc/network.subr
  stable/8/etc/rc.d/wpa_supplicant

Modified: stable/8/etc/network.subr
==============================================================================
--- stable/8/etc/network.subr	Wed Aug 26 21:05:17 2009	(r196565)
+++ stable/8/etc/network.subr	Wed Aug 26 21:08:41 2009	(r196566)
@@ -816,6 +816,17 @@ hexprint()
 	echo ${str}
 }
 
+is_wired_interface()
+{
+	local media
+
+	case `ifconfig $1 2>/dev/null` in
+	*media:?Ethernet*) media=Ethernet ;;
+	esac
+
+	test "$media" = "Ethernet"
+}
+
 # Setup the interfaces for IPv6
 network6_interface_setup()
 {
@@ -858,14 +869,19 @@ network6_interface_setup()
 			ifconfig $i inet6 ${ipv6_ifconfig} alias
 		fi
 
+		# Wireless NIC cards are virtualized through the wlan interface
+		if ! is_wired_interface ${i}; then
+			case "${i}" in
+			wlan*)	rtsol_available=yes ;;
+			*)	rtsol_available=no ;;
+			esac
+		fi
+
 		if [ ${rtsol_available} = yes -a ${rtsol_interface} = yes ]
 		then
 			case ${i} in
 			lo0|gif[0-9]*|stf[0-9]*|faith[0-9]*|lp[0-9]*|sl[0-9]*|tun[0-9]*|pflog[0-9]*|pfsync[0-9]*)
 				;;
-			# Wireless NIC cards are virtualized through the wlan interface
-			an[0-9]*|ath[0-9]*|ipw[0-9]*|iwi[0-9]*|iwn[0-9]*|ral[0-9]*|wi[0-9]*|wl[0-9]*|wpi[0-9]*)
-				;;
 			*)
 				rtsol_interfaces="${rtsol_interfaces} ${i}"
 				;;

Modified: stable/8/etc/rc.d/wpa_supplicant
==============================================================================
--- stable/8/etc/rc.d/wpa_supplicant	Wed Aug 26 21:05:17 2009	(r196565)
+++ stable/8/etc/rc.d/wpa_supplicant	Wed Aug 26 21:08:41 2009	(r196566)
@@ -18,18 +18,6 @@ if [ -z "$ifn" ]; then
 	return 1
 fi
 
-is_wired_interface()
-{
-	media=`ifconfig $1 2>/dev/null | while read line; do
-		case "$line" in
-		*media:?Ethernet*)
-			echo Ethernet
-			;;
-		esac
-	done`
-	test "$media" = "Ethernet"
-}
-
 is_ndis_interface()
 {
 	case `sysctl -n net.wlan.${1#wlan}.%parent 2>/dev/null` in



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