Bug 228253

Summary: ifup-wireless should bring link up before setting ESSID
Product: [Fedora] Fedora Reporter: Pekka Savola <pekkas>
Component: initscriptsAssignee: Bill Nottingham <notting>
Status: CLOSED RAWHIDE QA Contact: Brock Organ <borgan>
Severity: high Docs Contact:
Priority: medium    
Version: 6CC: baris, gajownik, pwaldenlinux, redhat, rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 8.52-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-04-16 22:54:06 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Pekka Savola 2007-02-12 07:34:36 UTC
On new USB stick WLAN interface (driver zd1211rw) it seems that the 'ip link set
$DEVICE up' needs to be done before ESSID is set for the card to come up at all.
(On the other hand, for example, the old orinoco_cs doesn't require this.)
                                                                               
                        
Even though DHCP client (run after ESSID is set) brings up the link, the WLAN
card is not associated to the AP (the state as shown below), and IP doesn't work
yet.
                                                                               
                        
zd1211rw people had the opinion that this is a problem with ifup:
                                                                               
                        
"This is a distro bug - it should bring the interface up before using it. Many
drivers require the interface to be up before scanning is possible, since for a
lot of hardware, scanning is just transmission and reception of frames so
requires the entire MAC layer to be activated just the same as if you were
transmitting/receiving data."
                                                                               
                        
Should this be fixed by setting the link up before setting ESSID in
ifup-wireless (or even before setting some other iwconfig options)?
                                                                               
                        
Is there any drawback in doing so? (At least it seems to me that you may not be
able to specify a new MACADDR if this was done.)
                                                                               
                        
eth1      IEEE 802.11b/g  ESSID:"S"  Nickname:"zd1211"
          Mode:Managed  Frequency:2.412 GHz  Access Point: Invalid
          Bit Rate=1 Mb/s
          Encryption key:off
          Link Quality:0  Signal level:0  Noise level:0
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

Comment 1 Ola Thoresen 2007-02-12 08:23:26 UTC
I have this and a related problem.
This one is patched with a simple:


--- ifup-wireless.orig  2007-02-09 07:38:59.000000000 +0100
+++ ifup-wireless       2007-02-12 09:10:41.000000000 +0100
@@ -30,6 +30,9 @@
 
 # Only meant to be called from ifup.
 
+# We need to set the device up before we can use iwconfig
+/sbin/ip link set $DEVICE up
+
 # Mode need to be first : some settings apply only in a specific mode !
 if [ -n "$MODE" ] ; then
     iwconfig $DEVICE mode $MODE


The other problem I believe is related is that it seems like DHCP does not work
on the wireless link if I have a key set.
Not sure if this is a problem with the rt73-driver or a more common issue.
As far as I can tell from my debugging it seems like dhclient will reset the
device (ip link down; ip link up).  When this is done, the key is reset to "off"
and DHCP will ofcourse does not work.
If I either use a static ip or turn off wep I have no problem with the usbstick.

Another solution is to log in on a different tty and manually set the key
("iwconfig rausb0 key xxxxxx") while dhclient is trying to get an address.


Comment 2 Baris Cicek 2007-02-12 11:09:14 UTC
I had ip line as following on my script at exactly same place. Though not quite
sure if dev is necessary (seems not). 

/sbin/ip link set dev $DEVICE up

I'm using^Wtesting ifup-wireless since kernel 2.6.18-x released for FC5, and
still no problem with latest kernel on FC6. 

I can confirm that DHCP problem is totally related with device is not up state
before setting WEP KEY and ESSID. 

Comment 3 Philip Walden 2007-03-11 17:19:59 UTC
I can verify the DHCP problem, although I think this should be reported as a
separate bug.

I use FC6 NetworkManager with a WEP hex key. At boot and then login, I get a
reliable DHCP request completion. If I attempt a network switch (to a different
SSID) and then attempt a reconnect, the DHCP always fails. If I then unplug the
USB device and then re-insert it, the DHCP request will succeed.

Appears to be an re-entrancy problem somewhere, perhaps in the driver as the
re-isertion forces a re-initialization.

Comment 4 Bill Nottingham 2007-04-16 22:52:37 UTC
Setting the link up first added in CVS, will be in 8.52-1, and will be in any
future FC6 update.