Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 171447 - net-wireless/ipw3945-1.2.0 network does not work properly with macchanger
Summary: net-wireless/ipw3945-1.2.0 network does not work properly with macchanger
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: x86 Linux
: High normal
Assignee: Christian Heim (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-03-19 15:24 UTC by Nico R.
Modified: 2007-09-09 08:37 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nico R. 2007-03-19 15:24:09 UTC
If you set (for example) "random-samekind" as macchanger option in /etc/conf.d/net for an Intel 3945ABG network interface, the network will not start up properly.

A workaround is to add "sleep 3" after the macchanger command in /lib/rcscripts/net/macchanger.sh:

--- /lib/rcscripts/net/macchanger.sh.orig       2007-02-17 12:00:46.000000000 +0100
+++ /lib/rcscripts/net/macchanger.sh    2007-03-19 15:21:25.000000000 +0100
@@ -86,6 +86,9 @@
                        | sed -n -e 's/^Faked MAC:.*\<\(..:..:..:..:..:..\)\>.*/\U\1/p' )
        fi
 
+       # Necessary for ipw3945d, it seems.
+       sleep 3
+
        if [[ -z ${mac} ]] ; then
                eend 1 "Failed to set MAC address"
                return 1


I assume there must be a better solution...

Reproducible: Always

Steps to Reproduce:
0. Use a Intel 3945ABG card as eth1 and have net-wireless/ipw3945, net-wireless/ipw3945d, and net-wireless/ipw3945-ucode installed.
1. Set 'mac_eth1="random-samekind"' in /etc/conf.d/net.
2. Kill ipw3945d, remove its pid file, remove the ipw3945, ieee80211, and ieee80211_crypt module.
3. Run 'modprobe ipw3945'. This will implicitly execute '/etc/init.d/ipw3945d start' with current versions of ipw3945d (1.7.22-r4) after the module has been loaded.
4. Run '/etc/init.d/net.eth1 start'.
Actual Results:  
/etc/init.d/net.eth1 fails, because iwconfig is run before the MAC change has been successfully completed (I think; somebody should check and confirm that).

Expected Results:  
/etc/init.d/net.eth1 start should not fail; the script should wait until ipw3945d has changed the MAC address of the network adapter before trying to run iwconfig.

Versions used:
sys-apps/baselayout-1.12.9
net-wireless/ipw3945-1.2.0
net-wireless/ipw3945-ucode-1.14.2
net-wireless/ipw3945d-1.7.22-r4
Comment 1 Roy Marples (RETIRED) gentoo-dev 2007-05-03 11:37:31 UTC
You put a sleep between the mac variable being set and being tested - in other words it does nothing.
Comment 2 Nico R. 2007-05-09 10:22:09 UTC
I put the sleep *after macchanger is run*. That's what's important. You could also move the sleep further down right before the return, I assume.

It does not do nothing: it pauses execution of the network scripts. Without the sleep, the problem arises; with the sleep command, it doesn't.

I think ipw3945d needs some time to set the mac address on the card.
Comment 3 Roy Marples (RETIRED) gentoo-dev 2007-05-09 10:33:34 UTC
Adding sleeps for buggy drivers suck. Fix the driver :)
Comment 4 Christian Heim (RETIRED) gentoo-dev 2007-09-09 08:37:56 UTC
(In reply to comment #3)
> Adding sleeps for buggy drivers suck. Fix the driver :)

It sucks, yes .. but in this case, it's the only way to get the retarded thing working.

This should be fixed w/ 1.2.2 (which contains a note about adding the preup hook to /etc/conf.d/net as suggested by Momsen in bug 177869 comment0).