From owner-freebsd-bugs@FreeBSD.ORG Fri Feb 27 20:50:02 2009 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D9E21065673 for ; Fri, 27 Feb 2009 20:50:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 289F18FC27 for ; Fri, 27 Feb 2009 20:50:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n1RKo2LX006812 for ; Fri, 27 Feb 2009 20:50:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n1RKo29J006811; Fri, 27 Feb 2009 20:50:02 GMT (envelope-from gnats) Resent-Date: Fri, 27 Feb 2009 20:50:02 GMT Resent-Message-Id: <200902272050.n1RKo29J006811@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, David Horn Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0509E106566B for ; Fri, 27 Feb 2009 20:48:24 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id CD29B8FC15 for ; Fri, 27 Feb 2009 20:48:23 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id n1RKmNSp052607 for ; Fri, 27 Feb 2009 20:48:23 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id n1RKmNjD052606; Fri, 27 Feb 2009 20:48:23 GMT (envelope-from nobody) Message-Id: <200902272048.n1RKmNjD052606@www.freebsd.org> Date: Fri, 27 Feb 2009 20:48:23 GMT From: David Horn To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: conf/132179: [patch] /etc/network.subr: ipv6 rtsol on incorrect wlan interface X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Feb 2009 20:50:02 -0000 >Number: 132179 >Category: conf >Synopsis: [patch] /etc/network.subr: ipv6 rtsol on incorrect wlan interface >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Feb 27 20:50:01 UTC 2009 >Closed-Date: >Last-Modified: >Originator: David Horn >Release: -current as of Feb 26 2009 >Organization: >Environment: FreeBSD top-bsd 8.0-CURRENT FreeBSD 8.0-CURRENT #2: Thu Feb 26 03:23:18 EST 2009 dhorn@top-bsd.private.nullcore.com:/usr/obj/usr/src/sys/DHORN i386 >Description: in /etc/network.subr, in function network6_interface_setup: The incorrect wlan network interfaces will be eligible for rtsol. If rtsol is called for a wireless hardware interface rather than the wlanX interface, it will fail to send a router solicitation, and will give spurious errors like: get_llflag() failed, anyway I'll try sendmsg on iwn0: Can't assign requested address sendmsg on iwn0: Can't assign requested address sendmsg on iwn0: Can't assign requested address This is not just innocuous, as the way that rtsol is called, only the first interface is actually eligible, so wlan0 will never be initialized by rtsol, This may not be easily noticeable depending on ipv6 router advertisement timing. My patch dynamically determines if an interface is 802.11, and NOT named wlanX to remove eligibility. >How-To-Repeat: Setup a machine with a wireless interface and ipv6 enabled and setup in rc.conf e.g. ipv6_enabled="YES" wlans_iwn0=wlan0 ifconfig_wlan0="WPA DHCP" with appropriate wpa_supplicant.conf configured Watch for get_llflag() failed errors on boot >Fix: unified diff attached. Patch attached with submission follows: --- /usr/src/etc/network.subr 2009-02-04 13:20:27.000000000 -0500 +++ /etc/network.subr 2009-02-27 15:19:15.000000000 -0500 @@ -852,10 +852,28 @@ rtsol_available=no rtsol_interface=no ifconfig $i inet6 ${ipv6_ifconfig} alias fi + # allow rtsol on wlan software interfaces e.g. wlan0, + # but not on wlan hardware interfaces e.g. iwn0 + case "$i" in + wlan[0-9]*) + ;; + *) + device=`ifconfig $i 2>/dev/null | while read line; do + case "$line" in + *media:?IEEE?802.11*) + echo 802.11_hardware + ;; + esac + done` + if [ "$device" = "802.11_hardware" ]; then + rtsol_interface=no + fi + ;; + esac 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]*) ;; >Release-Note: >Audit-Trail: >Unformatted: