From toor@gnbfw.bond.wattle.id.au  Tue Aug 20 19:24:56 2002
Return-Path: <toor@gnbfw.bond.wattle.id.au>
Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 3D4A237B400
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 20 Aug 2002 19:24:56 -0700 (PDT)
Received: from gnbfw.bond.wattle.id.au (CPE-203-45-32-179.vic.bigpond.net.au [203.45.32.179])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 94C4743E42
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 20 Aug 2002 19:24:54 -0700 (PDT)
	(envelope-from toor@gnbfw.bond.wattle.id.au)
Received: from gnbfw.bond.wattle.id.au (smmsp@localhost.bond.wattle.id.au [127.0.0.1])
	by gnbfw.bond.wattle.id.au (8.12.5/8.12.5) with ESMTP id g7L2Oq8r068298
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 21 Aug 2002 12:24:52 +1000 (EST)
	(envelope-from toor@gnbfw.bond.wattle.id.au)
Received: (from root@localhost)
	by gnbfw.bond.wattle.id.au (8.12.5/8.12.5/Submit) id g7L2Oocv068297;
	Wed, 21 Aug 2002 12:24:50 +1000 (EST)
Message-Id: <200208210224.g7L2Oocv068297@gnbfw.bond.wattle.id.au>
Date: Wed, 21 Aug 2002 12:24:50 +1000 (EST)
From: Gregory Bond <gnb@itga.com.au>
To: FreeBSD-gnats-submit@freebsd.org
Subject: wi(4) hostap mode won't work with WEP
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         41834
>Category:       kern
>Synopsis:       wi(4) hostap mode won't work with WEP
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Aug 20 19:30:00 PDT 2002
>Closed-Date:    Wed Sep 18 07:14:22 PDT 2002
>Last-Modified:  Wed Sep 18 07:14:22 PDT 2002
>Originator:     Gregory Bond <gnb@itga.com.au>
>Release:        FreeBSD 4.6-STABLE i386
>Organization:
ITG Australia Ltd
>Environment:
System: FreeBSD gnbfw.bond.wattle.id.au 4.6-STABLE FreeBSD 4.6-STABLE #3: Sat Jul 20 16:45:58 EST 2002 root@gregbsd.bond.wattle.id.au:/usr/obj/usr/src/sys/FW i386

Ancient Pentium-100 box acting as a firewall.

wi(4) running on a DLink 520
Client is a WinMe laptop with a DLink 650

wi0: <Intersil Prism2.5> mem 0xfbfe0000-0xfbfe0fff irq 11 at device 12.0 on pci0
wi0: 802.11 address: 00:05:5d:5b:c4:c8
wi0: using RF:PRISM2.5 MAC:ISL3874A(Mini-PCI)
wi0: Intersil Firmware: Primary 1.00.05, Station 1.03.04


>Description:

Using the wi(4) driver in ad-hoc mode, I can enable WEP on both
ends and it works fine.

In hostap mode, and without WEP, it works fine.

In hostap mode with WEP enabled, the laptop cannot get an association.
As soon as I turn WEP off on both ends, the laptop can get an
association.

I'm using Hex keys, and even simple unambiguous keys (like 0x11111...).
I've tried 64 and 128 bit WEP.



I've asked about this in the -stable list, and gotten a couple of
"me too"s from people with other wireless cards, but no answers.
So I don't think it's necessarily a case of user error.

(Yes, I know WEP is not much chop but it's good enough to stop
casual leeching of my cable link.)

[Severity is Serious/medium because it is very unwise to run wireless
without some sort of security.]

As an aside, I can't go from hostap mode back to ad-hoc mode without
a reboot, it gets ENXIO.  Looking at if_wi.c, something like this
appears to be deliberate (in wi_media_change(), line 2846ff), but
I think the ENXIO is coming from sys/net/if_media.c:ifmedia_ioctl(),
due to ifmedia_match() failing, which is very very odd.....

>How-To-Repeat:

# ifconfig wi0 inet <whatever> netmask <whatever> ssid <whatever> wepkey <whatever>
(Put laptop in Ad-Hoc mode with same key)

Note that the link works.

# ifconfig wi0 wepkey <whatever> mediaopt hostap
(Put laptop in BSS mode)

Note failure to get an association.

# ifconfig wi0 -wep
(And turn WEP off on the laptopo)

Note the laptop is able to associate.

# ifconfig wi0 mediaopt adhoc
ifconfig: SIOCSIFMEDIA: Device not configured
#

>Fix:

None known.  Possible work-around is to use IPSEC or PPPoE for
network security.

I'm willing to play around with this box if anyone can give me some 
pointers or wants me to try some debugging.
>Release-Note:
>Audit-Trail:

From: Gregory Bond <gnb@itga.com.au>
To: freebsd-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: kern/41834: wi(4) hostap mode won't work with WEP
Date: Mon, 02 Sep 2002 12:44:27 +1000

 I've done a whole heap more testing on this, and I'm still very confused.
 
 I've loaded a recent FreeBSD onto the laptop, and tested that as well, and all 
 up I have the following matrix:
 
 Host is a P-100 with a DLink DWL520 PCI card, running a recent -Stable (4.6+)
 
 Client is a Toshiba laptop with a DLink DWL650 PCMCIA card
 
 Client OS              WindowsME       FreeBSD
 
 Configuration
 Ad-Hoc, no WEP         Works           Works
 Ad-Hoc, 64bit WEP      Works           Works
 Ad-Hoc, 128bit WEP     Works           Works
 
 Hostap, no WEP         Works           Works
 Hostap, 64bit WEP      Doesn't Work    Works
 Hostap, 128bit WEP     Doesn't Work    Works
 
 Switching between Ad-Hoc and Hostap mode on the server often doesn't work
 without a reboot.  It usually can't be done at all with ifconfig, you have to
 use wicontrol.  And sometimes it needs a powercycle as well.  I've not managed 
 to work out any pattern to the mode-change failure yet.  No such problems were 
 encountered changing the mode under FreeBSD on the laptop.
 
 This looks on the surface like the problem is in the Windows driver, but I
 can't imagine that a driver shipped over 12 months ago and not updated since
 could still have this sort of major bug in it....  I'm now scratching around
 for another access point or whatever to test it on.
 
 Any clues about how I might debug this further?
 
 
 

From: Gregory Bond <gnb@itga.com.au>
To: freebsd-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: kern/41834: wi(4) hostap mode won't work with WEP 
Date: Tue, 03 Sep 2002 17:30:52 +1000

 > I've done a whole heap more testing on this, and I'm still very confused.
 
 More testing, using an Apple Ti Powerbook and my laptop running FreeBSD and
 Windows ME.
 
 This works for every combination of Ad-hoc/Hostap, WEP/no-WEP, using
 either the Apple or FreeBSD as the access point and the Apple, FreeBSD
 and WindowsME as the client, _except_:  it will not work using the
 WindowsME client in Infrastructure mode with WEP enabled, with any access
 point we tried.
 
 This is almost certainly a bug in the D-Link windows driver.
 
 I have been using the latest version available on the dlink.com.au site
 (1.34) which is the same version as is on the CD that came with the
 card.  The dlink.com site has a later version; it's  "1.07.37F" on the
 config utility About page.  This version does work with WEP in
 Infrastructure mode using the Powerbook as the access point. I can't 
 check with the FreeBSD as an access point for a few days.
 
 Chalk it up to bad Windows drivers caused by stale vendor web page.
 
 This PR can be closed.
State-Changed-From-To: open->closed 
State-Changed-By: tom 
State-Changed-When: Wed Sep 18 07:13:27 PDT 2002 
State-Changed-Why:  
Closed at originator's request.  This problem seems to be due to a fault 
outside FreeBSD. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=41834 
>Unformatted:
