Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 126640 - network init scripts don't work with >net-wireless/madwifi-driver-0.1_pre20050420-r1
Summary: network init scripts don't work with >net-wireless/madwifi-driver-0.1_pre200...
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Roy Marples (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-03-18 02:16 UTC by Fabio Rossi
Modified: 2006-05-01 13:22 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 Fabio Rossi 2006-03-18 02:16:52 UTC
I have a wireless PCI card which works with madwifi drivers =net-wireless/madwifi-driver-0.1_pre20050420-r1 and network init scripts. The network is so configured:

key_MYESSID="MYKEY"
config_MYESSID=( "192.168.1.2/24" )
routes_MYESSID=( "default via 192.168.1.1" )
dns_servers_MYESSID=( "192.168.1.1" )
dns_domain_MYESSID="home.lan"
preferred_aps=( "MYESSID" )
associate_order="forcepreferredonly"

The broadcast of ESSID is disabled.

Yesterday I upgraded to the 0.1473.20060312 version. At the boot I get this error:

# /etc/init.d/net.ath0 start
 * Starting ath0
 *   Configuring wireless network for ath0
 *   Trying to force preferred in case they are hidden
 *   Failed to associate with any preferred access points on ath0
 *   Couldn't find any access points on ath0
 *   Failed to configure wireless for ath0

# ifconfig ath0
ath0      Link encap:Ethernet  HWaddr xx:xx:xx:xx:xx:xx
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

# iwconfig ath0
ath0      IEEE 802.11a  ESSID:""  Nickname:"MYESSID"
          Mode:Managed  Channel:0  Access Point: Not-Associated
          Bit Rate:0 kb/s   Tx-Power:15 dBm   Sensitivity=0/3
          Retry:off   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off
          Link Quality=0/94  Signal level=-95 dBm  Noise level=-95 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

If I initialize the network by hand I have no problems:

# ifconfig ath0 192.168.1.2 up
# iwconfig ath0 essid MYESSID
# iwconfig ath0 key MYKEY
# route add default gw 192.168.1.1
# ping www.google.it
PING www.l.google.com (66.249.93.104) 56(84) bytes of data.
64 bytes from 66.249.93.104: icmp_seq=1 ttl=240 time=88.2 ms
64 bytes from 66.249.93.104: icmp_seq=2 ttl=240 time=85.9 ms
64 bytes from 66.249.93.104: icmp_seq=3 ttl=240 time=86.5 ms


I use =sys-apps/baselayout-1.11.14-r6 and =net-wireless/wireless-tools-28_pre14.
Here is my system information:

Portage 2.0.54 (default-linux/x86/2005.1, gcc-3.4.5, glibc-2.3.5-r2, 2.6.13-gentoo-r5 i686)
=================================================================
System uname: 2.6.13-gentoo-r5 i686 AMD Athlon(tm) Processor
Gentoo Base System version 1.6.14
dev-lang/python:     2.3.5-r2, 2.4.2
sys-apps/sandbox:    1.2.12
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1
sys-devel/binutils:  2.16.1
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=athlon-tbird -fomit-frame-pointer -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/lib/openoffice/share/dict/ooo /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/splash /etc/terminfo /etc/env.d"
CXXFLAGS="-O2 -march=athlon-tbird -fomit-frame-pointer -pipe"
DISTDIR="/mnt/lfs/distfiles/"
FEATURES="autoconfig distlocks sandbox sfperms strict"
GENTOO_MIRRORS="http://www.die.unipd.it/pub/Linux/distributions/gentoo-sources/ http://ftp.students.cs.unibo.it/gentoo/"
LANG="it_IT.UTF-8"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 3dnow 3dnowext X aac acl alsa apache2 arts asf audiofile avi bash-completion berkdb bitmap-fonts blas boehm-gc bonobo browserplugin bzip2 cairo cddb cdparanoia cdr chroot cmucl crypt cups curl directfb dri dv dvb emboss encode ethereal examples exif expat fam fame fbcon ffmpeg fftw firefox flac foomaticdb fortran fpx gcj gd gdbm gif gimpprint glut gmp gnutls gphoto2 gpm graphviz gs gtk gtk2 gtkhtml guile idn imagemagick imlib innodb java jbig jpeg jpeg2k kde kdeenablefinal lcms libg++ libwww live lm_sensors logitech-mouse lzo mad mhash mikmod mime mjpeg mmx mmxext mng motif mozdevelop mozsvg mozxmlterm mp3 mpeg mysql ncurses network nls nntp nptl odbc ogg oggvorbis opengl oss pam pcre pdflib perl php plotutils png postgres ppds python qt quicktime readline real recode samba sdk sdl skey smime speex spell sql ssl stats subversion svg tcltk tcpd tetex theora threads tiff truetype truetype-fonts type1 type1-fonts udev unicode usb utf8 vim-with-x vorbis wifi win32codecs wmf wxgtk1 wxwindows xanim xine xml xml2 xmms xv xvid yv12 zlib video_cards_radeon userland_GNU kernel_linux elibc_glibc"
Unset:  ASFLAGS, CTARGET, LC_ALL, LDFLAGS, LINGUAS
Comment 1 ordually 2006-03-18 15:08:23 UTC
I've had the same trouble, but with the stable version. 0.1443.20060207. The madwifi-driver-0.1_pre20050420-r1 version works fine. Same /etc/conf.d/wireless file, same baselayout, same everything except madwifi-driver versions. When running the current stable I see:


clackamas init.d # ./net.ath0 start
 * Starting ath0
 *   Configuring wireless network for ath0
 *   Couldn't associate with any access points on ath0
 *   Failed to configure wireless for ath0                                [ !! ]

Unmasking and emerging back with:

emerge -va '=net-wireless/madwifi-driver-0.1_pre20050420-r1

and re-adding the kernel module results in finding the network. 

Comment 2 Fabio Rossi 2006-03-19 03:54:36 UTC
(In reply to comment #1)
> I've had the same trouble, but with the stable version. 0.1443.20060207. The
> madwifi-driver-0.1_pre20050420-r1 version works fine.

Yes, like me too. The only working version is =net-wireless/madwifi-driver-0.1_pre20050420-r1
Comment 3 Roy Marples (RETIRED) gentoo-dev 2006-03-19 08:12:02 UTC
This an issue with madwifi - re-assigning to mobile
Comment 4 Henrik Brix Andersen 2006-03-19 08:38:11 UTC
Comment #0 clearly states that the problem only arises when using baselayout wireless scripts - not when doing manual configuration using iwconfig/ifconfig (Reassigning).

That being said: reporter, can you please try to reproduce this using =net-wireless/madwifi-{driver,tools}-0.1443.20060207?
Comment 5 Fabio Rossi 2006-03-19 14:00:16 UTC
(In reply to comment #4)
> That being said: reporter, can you please try to reproduce this using
> =net-wireless/madwifi-{driver,tools}-0.1443.20060207?

Yes, I confirm the same behaviour also for the version 0.1443.20060207
Comment 6 Fabio Rossi 2006-03-22 13:07:53 UTC
How can I detect the problem in the init scripts?
Comment 7 Fabio Rossi 2006-04-01 06:13:03 UTC
I have tested also madwifi-driver-0.1485.20060325 and wireless-tools-28_pre16. The problem is still in the init scripts :-( How can I debug them?
Comment 8 Roy Marples (RETIRED) gentoo-dev 2006-04-08 01:57:10 UTC
Please test with baselayout-1.12.0_pre17
Comment 9 Fabio Rossi 2006-04-15 05:16:05 UTC
I have just tested baselayout-1.12.0_pre17-r2 with madwifi-ng-0.1485.20060325 and wireless-tools-28_pre16.

At the boot I *always* get

 * Starting ath0
 *   Loading networking modules for ath0
 *     modules: apipa arping ccwgroup macchanger macnet rename iwconfig essidnet iptunnel ifconfig system dhcpcd ip6to4
 *       iwconfig provides wireless
 *       ifconfig provides interface
 *       dhcpcd provides dhcp
 *   Configuring ath0 for MAC address xx:xx:xx:xx:xx:xx ...                                                                               
 *   Configuring wireless network for ath0
 *   Trying to force preferred in case they are hidden
 *   Connecting to "MYESSID" in managed mode (WEP enabled - restricted) ...                                                                                  
 *   Failed to associate with any preferred access points on ath0
 *   Couldn't find any access points on ath0
 *   Failed to configure wireless for ath0                                                                                                                

After logging and after one or two tries the network get initialized

# /etc/init.d/net.ath0 start
 * Starting ath0
 *   Loading networking modules for ath0
 *     modules: apipa arping ccwgroup macchanger macnet rename iwconfig essidnet iptunnel ifconfig system dhcpcd ip6to4
 *       iwconfig provides wireless
 *       ifconfig provides interface
 *       dhcpcd provides dhcp
 *   Configuring ath0 for MAC address xx:xx:xx:xx:xx:xx ...                                                                                               
 *   Configuring wireless network for ath0
 *   Trying to force preferred in case they are hidden
 *   Connecting to "MYESSID" in managed mode (WEP enabled - restricted) ...                                                                                  
 *     ath0 connected to ESSID "MYESSID" at xx:xx:xx:xx:xx:xx
 *     in managed mode on channel 11 (WEP enabled - restricted)
 *   Configuring ath0 for ESSID "MYESSID" ...                                                                                                                
 *   Bringing up ath0
 *     192.168.1.2/24                                                                                                                                     
 *   Adding routes
 *     default via 192.168.1.1 ...                                                                                                                        

Do you have any suggestions?
Comment 10 Chris Bainbridge (RETIRED) gentoo-dev 2006-04-17 09:57:28 UTC
I now have this problem with madwifi-ng. The problem seems to be this function from /lib/rcscripts/net.modules.d/wpa_supplicant:

wpa_supplicant_associated() {
        local -a status=( "$( wpa_cli -i${1} status | awk -F= '/^key_mgmt|^wpa_state|^EAP state/ { print "\""$2"\"" }' )" )
        #echo "status0=${status[0]}" >> /tmp/log && sync
        #echo "status1=${status[1]}" >> /tmp/log && sync

        case ${status[0]} in
                "NONE"  )               [[ ${status[1]} == "ASSOCIATED" || ${status[1]} == "COMPLETED" ]] ;;
                "IEEE 802.1X (no WPA)") [[ ${status[2]} == "SUCCESS" ]] ;;
                *)                      [[ ${status[1]} == "COMPLETED" ]] ;;
        esac
        return $?
}

It seems that everything in the expanded variable gets assigned to the first entry in the array. If I uncomment the commented out lines in /tmp/log I get:

status0="NONE"
"COMPLETED"
status1=

wpa_cli returns:
# wpa_cli -iath0 status
bssid=00:30:f1:c3:6e:a4
ssid=toms
pairwise_cipher=NONE
group_cipher=NONE
key_mgmt=NONE
wpa_state=COMPLETED
ip_address=192.168.2.16
Comment 11 Roy Marples (RETIRED) gentoo-dev 2006-04-18 00:18:05 UTC
(In reply to comment #10)
> I now have this problem with madwifi-ng. The problem seems to be this function
> from /lib/rcscripts/net.modules.d/wpa_supplicant:

Hmmmm, that's from 1.11.14-r7 or worse. -r8 is now in portage, please test with that or 1.12.0_pre17-r2
Comment 12 Fabio Rossi 2006-04-18 10:53:58 UTC
(In reply to comment #11)
> Hmmmm, that's from 1.11.14-r7 or worse. -r8 is now in portage, please test with
> that or 1.12.0_pre17-r2

My problem is not related to wpa_supplicant and I have already tested with 1.12.0_pre17-r2 without success :-(
Comment 13 Fabio Rossi 2006-05-01 12:08:16 UTC
Tested also madwifi-ng-0.1531.20060427 and baselayout-1.12.0_pre18-r1, same problem.
Comment 14 Roy Marples (RETIRED) gentoo-dev 2006-05-01 12:27:51 UTC
Right. Someone else is going to have to fix this problem as wpa_supplicant and/or iwconfig works just dandy with my madwifi on amd64 with the versions listed above. Personally I don't think this is an issue with baselayout.

The issue seems to be that the signal from the AP as you have said it *sometimes* works. If so, then using wpa_supplicant is the better choice even if you don't use WPA as it supports madwifi AND scans for access points when not associated until it finally associates, whereas iwconfig is purely a one shot afair.

If it's any consolation, I sometimes get a similar issue with my rt2500 based card as it's upstairs and my AP is downstairs. Sometimes it doesn't find the AP. However a madwifi card in the same box works much better as it uses wpa_supplicant to manage the connection.
Comment 15 Fabio Rossi 2006-05-01 12:48:13 UTC
(In reply to comment #14)
> The issue seems to be that the signal from the AP as you have said it
> *sometimes* works.

The behavious is deterministic, not random: on machine startup the sequence is *always* the same:

1) during init scripts the network isn't initialized
2) login
3) manual `/etc/init.d/net.ath0 start`
4) network successfully initialized

If the operation 3) is delayed too much, it's necessary to give the "start" command two times. I don't think it's a problem with the AP signal but a timeout one.
Comment 16 Roy Marples (RETIRED) gentoo-dev 2006-05-01 12:53:11 UTC
So increase the timeout then
associate_timeout_ath0=0 # infinite
associate_timeout_ath0=300 # wait 5 minutes
Comment 17 Fabio Rossi 2006-05-01 13:22:18 UTC
In the past I had tried the infinite timeout without luck (but with older madwifi and baselayout versions). I have just tried again... and this time it works!

Roy, thanks for your patience :-)