Subject: kern/23311: Re: S
To: None <gnats-bugs@gnats.netbsd.org>
From: pancake <pancake@phreaker.net>
List: netbsd-bugs
Date: 10/29/2003 23:38:25
>Number:         23311
>Category:       kern
>Synopsis:       Some channel modes segfaults the kernel
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Oct 29 23:41:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     localhost :)
>Release:        NetBSD 1.6ZD
>Organization:
>Environment:
System: NetBSD pl2 1.6ZD NetBSD 1.6ZD (PANCAKE_LAPTOP) #1: Sun Oct 26 02:32:21 UTC 2003 root@pl2:/usr/src/sys/arch/i386/compile/PANCAKE_LAPTOP i386
Architecture: i386
Machine: i386
>Description:
	
	I send another patch before, that doesn't solve everything, and was
	not fully tested. This new patch solves better the problem and
	is tested :)
>How-To-Repeat:
	The same as before:
	# ifconfig wi0 media DS11 mediaopt hostap

>Fix:
	Apply this patch:

--- sys/net80211/ieee80211.c.orig	2003-10-16 23:25:00.000000000 +0100
+++ sys/net80211/ieee80211.c	2003-10-29 22:42:38.000000000 +0000
@@ -77,6 +77,7 @@
 
 #include <net80211/ieee80211_var.h>
 #include <net80211/ieee80211_compat.h>
+#include <dev/ic/icpreg.h>
 
 #include <net/bpf.h>
 
@@ -794,6 +795,9 @@
 	 */
 	if (ic->ic_curmode != IEEE80211_MODE_AUTO)
 		return ic->ic_curmode;
+
+	if (chan == ICP_INVALID_CHANNEL)
+		return ic->ic_curmode;
 	/*
 	 * In autoselect mode; deduce a mode based on the channel
 	 * characteristics.  We assume that turbo-only channels
>Release-Note:
>Audit-Trail:
>Unformatted: