On my system, the /lib/rcscripts/net.modules.d/iwconfig script does not work properly with my wireless net card (which uses the rt2500 driver)" it appears that its attempt to set the essid is happening too quickly after the script sets the WEP key, and is ignored, If I insert a "sleep 1" before the "the iwconfig essid..." section of the script, it works. I cannot tell if the problem lies within /sbin/iwconfig tiself, or the driver, but it appears that the command is ignored (but with a zero return code). This in turn will cause dhcpcd to fail. The kludgy workaround is obvious: insert the "sleep 1" line into the script at the critical point. This may not be necessary for non-preemptible kernels - mine is preemptible. here are system particulars that relate to this problem: ~ # emerge info Portage 2.0.53 (default-linux/x86/2005.1, gcc-3.3.6, glibc-2.3.5-r3, 2.6.14-gentoo-r4 i686) ================================================================= System uname: 2.6.14-gentoo-r4 i686 Unknown CPU Typ Gentoo Base System version 1.12.0_pre11 dev-lang/python: 2.3.5, 2.4.2 sys-apps/sandbox: 1.2.17 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-r1 sys-devel/libtool: 1.5.20-r1 virtual/os-headers: 2.6.11-r3 ACCEPT_KEYWORDS="x86 ~x86" AUTOCLEAN="yes" CBUILD="i686-pc-linux-gnu" CFLAGS="-march=athlon-xp -O2" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/lib/X11/xkb /usr/share/config /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/texmf/web2c /etc/env.d" CXXFLAGS="-march=athlon-xp -O2" DISTDIR="/usr/portage/distfiles" FEATURES="autoconfig distlocks sandbox sfperms strict" GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="/ 3dnow 3dnowext X Xaw3d a52 aac acpi aim alsa applet artworkextra audiofile avi bash-completion berkdb bigger-fonts bitmap-fonts bzip2 cdda cddb cdio cdparanoia cdr cpudetection crypt cups curl dillo divx4linux doc dpms dts dv dvbdvd dvdr dvdread eds encode epson esd exif expat fam ffmpeg fftw flac foomaticdb fortran freetype gb gcj gdbm gif gimpprint glut gnome gnome-print gpm gstreamer gtk gtk2 imagemagick imlib jack java javascript john jpeg kernel_linux lcms libg++ libwww lirc lm_sensors mad mikmod mime mjpeg mmx mmxext mng motif mozilla mozsvg mp3 mpeg mplayer mysql mythtv ncurses nfs nptl offensive ogg oggvorbis opengl pam pcre pdflib perl png ppds python qt quicktime readline real recode rtc samba sdl sensord shorten slang sndfile sockets sox speedo spell ssl stream svg tcltk tcpd tetex theora tiff transcode truetype truetype-fonts type1 type1-fonts udev usb v4l v4l2 vcd vcdimager vidix vlm vorbis wifi win32codecs wxwindows x86 xanim xface xine xml xml2 xmms xpm xv xvmc zlib userland_GNU elibc_glibc" Unset: ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTDIR_OVERLAY BTW, the "unknown CPU Typ" shown above in "emerge info" is an overclocked AthlonXP 2500 Mobile; I doubt it is important, here. Contents of /etc/maodules.autolad.d/kernel-2.6: # /etc/modules.autoload.d/kernel-2.6: kernel modules to load when system boots. # # Note that this file is for 2.6 kernels. # # Add the names of modules that you'd like to load when the system # starts into this file, one per line. Comments begin with # and # are ignored. Read man modules.autoload for additional details. # For example: #3c59x rt2500 # must use nForce2 board's AGP driver, to get fglrx to work properly nvidia-agp fglrx Uncommented lines from /etc/conf.d/wireless (sanitized, but similar): essid_ra0=MyESSID key_MyESSID="0000-0000-0000-0000-0000-0000-00"" With this configuration and an unmodified /lib/rcscripts/net.modules.d/iwconfig script, (and with "net.ra0" added to the default runlevel), the /etc/init.d/net.ra0 script will fail to start, due to timeout on dhcpcd, and doing an "iwconfig ra0" will show the WEP key set, but an essid of ""; if I add the "sleep 1" line to the script, just before it tries to set the essid, net.ra0 starts properly.
I have no wish to fix rt2500 driver specific issues as the rt2x00 driver will supercede the rt2500 driver and currently the rt2x00 driver works fine with our baselayout. However, the rt2x00 driver is currently very very alpha and does hang from time to time. You could try increasing sleep_associate_ra0 to something like 360 which would be insane but equivalent to your sleep statement.
Quick change of platform in bugzilla. Sorry about the email.
Please test with baselayout-1.12.0_pre12
(In reply to comment #3) > Please test with baselayout-1.12.0_pre12 > I did this afternoon, after doing a world update. It made no difference in the behavior of my system: the essid is not set during the execution of the (recently-replaced) /lib/rcscripts/net.modules.d/iwconfig script, while executing exactly the same call to /sbin/iwconfig that the script would make (in a script, BTW - that script is the easiest workaround for me, since it then executes the /etc/init.d/net.ra0 script and starts dhcpcd correctly for me) DOES work. I'm at a loss to explain this. Another data point, for those who don't like supporting "old" drivers, like rt2500 (versus rt2x00): I just tried switching over to the rt2x00 driver, which defaults (as installed by Gentoo) to the eth0 device on my system, and after making appropriate chenges to /etc/modules-autoload.d/kernel-2.6 and /etc/conf.d/wireless to match the new device name (and changing from net.ra0 to net.eth0), it did not work any better than the rt2500 driver. In fact, I'd say it worked even worse, since there did not appear to be any way to get dhcpcd to work with it, even if I set the WEP key manually - dhcpcd would just time out, and not give me an IP. Furthermore, it appeared to "taint" things, since without a reboot, I could not rmmod the rt2500pci module (along with rt2x00core, ieee80211, ieee80211_crypt_wep, and ieee80211_crypt), then modprobe the rt2500 module and get it to connect, either. (IT would work, after a reboot.(Furthermore, I'm not sure if this is related or not, since I only went through this path once and am not sure of its repeatability, I'd note that the first reboot after trying the "rt2x00, then rt2500" sequence terminated abruptly and self-rebooted; fortunately that boot was without incident, aside from the ones with which I started this bug. I'd also note that it appears that data related to essid and key is persisting somewhere (on the card, maybe?), since I did not need to reenter the WEP key after changing drivers. There appears to be no way available to me to do any kind of soft reset on the card, if that's the case.) The rt2x00 and ieee80211 driver software is as is currently available in Gentoo (w/ ~x86 set); the kernel version on my system is newer than it was when I started this (2.6.14-gentoo-r5, minus the ieee80211 code in the source tree but including that in the similarly-named package), a feature of doing the world update to get the suggested baselayout. If people really want it, I can repost an "emerge info", but I thin that this is probably more than you wanted to hear, already!
Please ensure that you have net-wireless/wireless-tools-28_pre13 installed. I do not see this error myself on my rt2500 pci card using the rt2500 driver btw. Also, we set the ESSID in two places in the script - which one depends on your config. So, attach your conf.d/net and conf.d/wireless to this bug please. Lastly, try splitting your text into small paragraphs as it makes it much easier to read :)
(In reply to comment #5) > Please ensure that you have net-wireless/wireless-tools-28_pre13 installed. > > I do not see this error myself on my rt2500 pci card using the rt2500 driver > btw. > > Also, we set the ESSID in two places in the script - which one depends on your > config. So, attach your conf.d/net and conf.d/wireless to this bug please. > > Lastly, try splitting your text into small paragraphs as it makes it much > easier to read :) > Fair enough - I'll try to keep it short! The non-comment lines of conf.d/wireless were in the original description; there are no non-comment lines in conf.d/net. And yes, I'm using wireless-tools-28_pre13. If you're curious, I've also tried a conf.d/wireless with the two (obviously sanitized) lines: key_MyESSID="0000-0000-0000-0000-0000-0000-00" preferred_aps=("MyESSID") This did not change the behavior. As reported before, "iwlist ra0 scan" produces no APs until essid and key are both set, and then only my AP. I should also not that doing a "iwconfig ra0 essid any" does not change the value of the essid, or change the behavior of the iwlist command.
(In reply to comment #6) > This did not change the behavior. As reported before, "iwlist ra0 scan" > produces no APs until essid and key are both set, and then only my AP. I should > also not that doing a "iwconfig ra0 essid any" does not change the value of the > essid, or change the behavior of the iwlist command. Does it work if you set the AP to broadcast it's ESSID? It sounds like the ESSID is hidden - and this is correct behaviour iirc.
(In reply to comment #7) > (In reply to comment #6) > > This did not change the behavior. As reported before, "iwlist ra0 scan" > > produces no APs until essid and key are both set, and then only my AP. I should > > also not that doing a "iwconfig ra0 essid any" does not change the value of the > > essid, or change the behavior of the iwlist command. > > Does it work if you set the AP to broadcast it's ESSID? > It sounds like the ESSID is hidden - and this is correct behaviour iirc. > That seemed to do the trick; in that case, since it's sort of a good idea, security-wise, to hide the essid, would it be possible to modify the behavior of the iwconfig rcscript to allow people to connect to hidden-essid APs? Right now, it appears that the path followed through the script doesn't allow this. At any rate, I'll certainly change the status to "fixed" - while it's not exactly how I'D like it to work, it certainly does seem to work!
One more thought - I suppose that someone should update some documentation, somewhere, to at least mention how a hidden essid messes up the operation of the script; and I suppose that there are poeple out there who don't have control over their router/AP - this does leave them out in the cold. Perhaps it's not quite fixed, after all... For my purposes, I think I'll try to set up a "preup" script for ra0, and get it to do the iwconfig stuff for me.
(In reply to comment #8) > That seemed to do the trick; in that case, since it's sort of a good idea, > security-wise, to hide the essid, would it be possible to modify the behavior > of the iwconfig rcscript to allow people to connect to hidden-essid APs? Right > now, it appears that the path followed through the script doesn't allow this. Well, you have hit on a driver issue. I just tested rt2500 against a hidden AP and I got the same thing. However, hidding the SSID just stops the casual war driver from finding something else out - there are tools to work out the SSID. Also, some drivers still require the SSID to be broadcast, although the rt2000 does sort of work. We do allow people to connect to hidden AP's, infact there is a variable especially for this. Checkout associate_order in wireless.example Lastly, I vastly dislike addeding sleeps at points in the code as that shows that I'm relying on something badly written.