/etc/network/if-pre-up.d/wireless-tools leaves the interface up, which breaks hwaddr setting

Bug #219520 reported by Andreas Kostyrka on 2008-04-19
4
Affects Status Importance Assigned to Milestone
wireless-tools (Ubuntu)
Medium
Unassigned

Bug Description

Binary package hint: wireless-tools

The preup script is "broken":

eth0 being my wired network interface, snippet from /etc/network/interfaces:

iface eth0 inet dhcp
hwaddress ether 00:0e:35:ca:c8:3e

Now, with the unpatched wireless preup, I get:
root@andi-lap:~# ifup --verbose eth0
Configuring interface eth0=eth0 (inet)
run-parts --verbose /etc/network/if-pre-up.d
run-parts: executing /etc/network/if-pre-up.d/wireless-tools
run-parts: executing /etc/network/if-pre-up.d/wpasupplicant
ifconfig eth0 hw ether 00:0e:35:ca:c8:3e
SIOCSIFHWADDR: Device or resource busy - you may need to down the interface
Failed to bring up eth0.

Adding the following to the bottom of the script fixes my problem:

if [ -x "$IFCONFIG" ]; then
  $IFCONFIG "$IFACE" down
fi

Only caveat, I'm not 100% sure if iwconfig settings survive an ifconfig down, but they should if I remember right. (I seem to remember that the fastest way to get a clean iwconfig state was reloading the ipw2100 module.)

Andreas

ProblemType: Bug
Architecture: i386
Date: Sat Apr 19 11:54:02 2008
Dependencies:
 libgcc1 1:4.2.3-2ubuntu7
 libiw29 29-1ubuntu2
 gcc-4.2-base 4.2.3-2ubuntu7
 libc6 2.7-10ubuntu3
DistroRelease: Ubuntu 8.04
Package: wireless-tools 29-1ubuntu2
PackageArchitecture: i386
ProcEnviron:
 SHELL=/bin/bash
 PATH=/home/username/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
 LANG=de_DE.UTF-8
SourcePackage: wireless-tools
Uname: Linux 2.6.24-16-generic i686

FWIW, Ubuntu has been carrying the attached patch to wireless-tools since
2006 (i.e., the time of Matthew's bug report).

Matthew, do you know if this is still needed for softmac? There's been at
least one bug report against wireless-tools in Ubuntu complaining that it
breaks other ifupdown functionality
(https://bugs.launchpad.net/bugs/219520), so if it's safe to drop this diff
now, I'd like for us to do that. I agree that conceptually, it's better to
set all of the wireless variables before bringing up the interface.

Thanks,
--
Steve Langasek Give me a lever long enough and a Free OS
Debian Developer to set it on, and I can move the world.
Ubuntu Developer http://www.debian.org/
<email address hidden> <email address hidden>

Changed in wireless-tools:
importance: Undecided → Medium
status: New → Confirmed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package wireless-tools - 29-1.1ubuntu2

---------------
wireless-tools (29-1.1ubuntu2) jaunty; urgency=low

  * Revert change to bring up the interface before changing wireless
    settings; the softmac driver this was implemented for is now
    obsolete, no other drivers are reported to need it, and it
    introduces other problems such as breaking PPP interfaces
    (LP: #268519) and preventing configuration of some settings such as
    hardware addresses (LP: #219520).

 -- Steve Langasek <email address hidden> Fri, 14 Nov 2008 21:13:27 +0000

Changed in wireless-tools:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers