Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 228253 - ifup-wireless should bring link up before setting ESSID
Summary: ifup-wireless should bring link up before setting ESSID
Alias: None
Product: Fedora
Classification: Fedora
Component: initscripts
Version: 6
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact: Brock Organ
Depends On:
TreeView+ depends on / blocked
Reported: 2007-02-12 07:34 UTC by Pekka Savola
Modified: 2014-03-17 03:05 UTC (History)
5 users (show)

Fixed In Version: 8.52-1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2007-04-16 22:54:06 UTC

Attachments (Terms of Use)

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

Note You need to log in before you can comment on or make changes to this bug.