From owner-svn-src-head@FreeBSD.ORG Sun Aug 23 05:47:19 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DC89B106568C; Sun, 23 Aug 2009 05:47:19 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B2AB28FC0C; Sun, 23 Aug 2009 05:47:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7N5lJA5048024; Sun, 23 Aug 2009 05:47:19 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7N5lJN5048021; Sun, 23 Aug 2009 05:47:19 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200908230547.n7N5lJN5048021@svn.freebsd.org> From: Doug Barton Date: Sun, 23 Aug 2009 05:47:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196436 - in head/etc: . rc.d X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Aug 2009 05:47:20 -0000 Author: dougb Date: Sun Aug 23 05:47:19 2009 New Revision: 196436 URL: http://svn.freebsd.org/changeset/base/196436 Log: 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. Modified: head/etc/network.subr head/etc/rc.d/wpa_supplicant Modified: head/etc/network.subr ============================================================================== --- head/etc/network.subr Sun Aug 23 05:45:38 2009 (r196435) +++ head/etc/network.subr Sun Aug 23 05:47:19 2009 (r196436) @@ -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: head/etc/rc.d/wpa_supplicant ============================================================================== --- head/etc/rc.d/wpa_supplicant Sun Aug 23 05:45:38 2009 (r196435) +++ head/etc/rc.d/wpa_supplicant Sun Aug 23 05:47:19 2009 (r196436) @@ -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