NetBSD Problem Report #49649

From bad@bsd.de  Sat Feb  7 16:50:00 2015
Return-Path: <bad@bsd.de>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id C1B2FA654C
	for <gnats-bugs@gnats.NetBSD.org>; Sat,  7 Feb 2015 16:50:00 +0000 (UTC)
Message-Id: <20150207164927.6693438446@limiting-factor.k.bsd.de>
Date: Sat,  7 Feb 2015 17:49:27 +0100 (MET)
From: bad@bsd.de
Reply-To: bad@bsd.de
To: gnats-bugs@gnats.NetBSD.org
Subject: iwn(4) open/protected network association problems
X-Send-Pr-Version: 3.95

>Number:         49649
>Category:       kern
>Synopsis:       iwn(4) switching between ifconfig for open networks and wpa_supplicant for protected networks doesn't work
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Feb 07 16:55:00 +0000 2015
>Originator:     Christoph Badura
>Release:        NetBSD 7.99.4
>Organization:
Bozotic Software Testing Labs

>Environment:


System: NetBSD size-isnt-everything 7.99.4 NetBSD 7.99.4 (GENERIC.201502020930Z) #0: Mon Feb  2 10:20:06 UTC 2015  snj@b45.netbsd.org:/home/builds/ab/HEAD/amd64/201502020930Z-obj/home/source/ab/HEAD/src/sys/arch/amd64/compile/GENERIC amd64
Architecture: x86_64
Machine: amd64

The same symptoms are present on:
NetBSD size-isnt-everything 6.1_STABLE NetBSD 6.1_STABLE (thinkpad-500) #4: Tue Feb  3 22:08:13 MET 2015  bad@size-isnt-everything:/u/0/trees/src/netbsd-6/sys/arch/amd64/compile/thinkpad-500 amd64

iwn0 at pci2 dev 0 function 0: vendor 8086 product 4236 (rev. 0x00)
iwn0: interrupting at ioapic0 pin 17
iwn0: MIMO 3T3R, MoW, address 00:21:6a:ab:62:48
iwn0: 11a rates: 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps
iwn0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps
iwn0: 11g rates: 1Mbps 2Mbps 5.5Mbps 11Mbps 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps

>Description:

There is bad interaction between using ifconfig to connect to open Wi-Fi
networks and wpa_supplicant to connect to WPA-protected networks.

After having used a wpa_supplicant to connect to a WPA-protected network
I cannot use ifconfig to connect to unprotected networks.  It seems there
are encryption keys still configured on the card.  Using "ifconfig -nwkey"
seems to clear them.  However, directly afterwards wpa_supplicant cannot
configure WPA.

I've never had this problem with ath(4) cards.

>How-To-Repeat:


# boot system.

ifconfig iwn0 ssid opennet up

# dhclient is able to obtain address

wpa_supplicant -i iwn0 -c protected.conf

# dhclient is able to obtain address

# stop wpa_supplicant with CTL-C

ifconfig iwn0 ssid opennet up

# dhclient cannot obtain address

ifconfig iwn0 -nwkey

# now dhclient can obtain address

wpa_supplicant -i iwn0 -c protected.conf

# now wpa_supplicant can't negotian WPA

wpa_supplicant -i iwn0 -c opennet.conf

# wpa_supplicant associates and dhclient can obtain address

wpa_supplicant -i iwn0 -c protected.conf

# now wpa_supplicant cann negociate WPA and dhclient can obtain address


opennet.conf:
	sid="opennet"
        scan_ssid=1
        key_mgmt=NONE
}

protected.conf:
network={
        ssid="wpaprotected"
        scan_ssid=1
        key_mgmt=WPA-PSK
        psk="hogehogehoge"
}


>Fix:


A work around is to use wpa_supplicant to connect to open networks.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.