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
You put a sleep between the mac variable being set and being tested - in other words it does nothing.
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.
Adding sleeps for buggy drivers suck. Fix the driver :)
(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).