Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 27 Feb 2009 20:48:23 GMT
From:      David Horn <dhorn2000@gmail.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   conf/132179: [patch] /etc/network.subr: ipv6 rtsol on incorrect wlan interface
Message-ID:  <200902272048.n1RKmNjD052606@www.freebsd.org>
Resent-Message-ID: <200902272050.n1RKo29J006811@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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:



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