Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 321663 - sys-kernel/gentoo-sources-2.6.33 regression: cause /proc/net/wireless is empty, wpa_supplicant fails to start with init script
Summary: sys-kernel/gentoo-sources-2.6.33 regression: cause /proc/net/wireless is empt...
Status: RESOLVED DUPLICATE of bug 307191
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard: linux-2.6.33-regression
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-27 10:35 UTC by Jan Buecken
Modified: 2011-02-20 17:12 UTC (History)
8 users (show)

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


Attachments
emerge --info (emergeinfo,3.64 KB, text/plain)
2010-06-07 09:26 UTC, Jan Buecken
Details
/etc/conf.d/net (net,1008 bytes, text/plain)
2010-06-07 09:27 UTC, Jan Buecken
Details
rc-status --all (rcstatusall,7.60 KB, text/plain)
2010-06-07 12:17 UTC, Jan Buecken
Details
git bisect log between 2.6.32 (good) and 2.6.33 (bad) (gitbisectlog,2.20 KB, text/plain)
2010-06-11 12:50 UTC, Jan Buecken
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Buecken 2010-05-27 10:35:51 UTC
First I thought this was a bug with wpa_supplicant, thus I posted is a bug decription upstream:http://hostap.epitest.fi/bugz/show_bug.cgi?id=358.

Further testing led to the following:
With a 2.6.32 kernel the net.wlan0 script starts wpa_supplicant and wpa_cli as expected. Booting a 2.6.33 or higher kernel the script doesn't start the wpa_supplicant or wpa_cli, but it starts ifplugd on my wireless device (surprising?). I have not changed any configuration, just dual boot wirth the different kernels.
I tested this with wpa_supplicant 0.6.9 0.7.1 and 0.7.2, 2.6.32-r7(gentoo), 2.6.32.9(vanilla), 2.6.33(gentoo) and 3.6.34(drm-radeon-testing branch by airlied).

This may affect baselayout or ifplugd, but I'm not sure, thus I chose Application as Component.

Best regards
Jan Bücken

Reproducible: Always

Steps to Reproduce:
1. Boot 2.6.32 kernel: wpa_supplicant is started with net.wlan0 script
2. Boot >=2.6.33 kernel: wpa_supplicant doesn't start with the script but ifplugd does...
Comment 1 Jan Buecken 2010-05-31 09:50:44 UTC
Uninstalled ifplugd, now I get:

#/etc/init.d/net.wlan0 restart
 * Stopping wlan0
 *   Bringing down wlan0
 *     Shutting down wlan0 ...                                                   [ ok ]
 * Starting wlan0
 *   Configuration not set for wlan0 - assuming DHCP
 *   Bringing up wlan0
 *     dhcp
 *       Running dhcpcd ...
wlan0: dhcpcd 4.0.15 starting
wlan0: waiting for carrier
wlan0: timed out 
Comment 2 Michael Weber (RETIRED) gentoo-dev 2010-06-07 01:43:23 UTC
Hello Jan,

please comment a `emerge --info` so that we see the baselayout version you use and such things. You might want to temper with rc_depend_strict and rc_hotplug in /etc/rc.conf, but that only applies to baselayput-2 afaik.

I've net.wlan0 in the defaukt runlevel and it "complains" about wlan0 `started but inactive`. 

The content of your /etc/conf.d/net might be usefull to.

Thanks, Michael
Comment 3 Jan Buecken 2010-06-07 09:26:36 UTC
Created attachment 234373 [details]
emerge --info
Comment 4 Jan Buecken 2010-06-07 09:27:19 UTC
Created attachment 234375 [details]
/etc/conf.d/net
Comment 5 Jan Buecken 2010-06-07 09:31:47 UTC
Hello Michael,

> I've net.wlan0 in the defaukt runlevel and it "complains" about wlan0 `started
> but inactive`. 

With rc-status I found out that I never add net.wlan0 to any runlevel, but it has been started on boot. Now I add it to the runlevel "default", but it makes no difference to the problem.
Comment 6 Michael Weber (RETIRED) gentoo-dev 2010-06-07 10:33:40 UTC
Ok, so this is a baselayout-1 system. 
Did you accidentally add a `need net` service to the boot runlevel?
net should be started in the default runlevel.
Can I ask for the output of `rc-status --all`, please?
Comment 7 Jan Buecken 2010-06-07 12:17:52 UTC
Created attachment 234385 [details]
rc-status --all

>Can I ask for the output of `rc-status --all`, please?

Here it is.
Comment 8 Jan Buecken 2010-06-07 13:07:18 UTC
(In reply to comment #6)
> Ok, so this is a baselayout-1 system. 
> Did you accidentally add a `need net` service to the boot runlevel?

I believe not that one of the services in "boot" needs net (except net.lo?), but could it be similar to this bug:
http://bugs.gentoo.org/show_bug.cgi?id=224639
?

Comment 9 Jan Essert 2010-06-08 18:57:22 UTC
I have the same problem with baselayout-2.0.1 and gentoo-sources-2.6.34.

Starting /etc/init.d/net.wlan0 starts either iwconfig if wireless-tools is installed, otherwise dhcpcd is tried directly.

wpa_supplicant does work manually, though.

Can I provide additional information?
Comment 10 Jan Buecken 2010-06-11 12:49:16 UTC
I did a kernel regression test. This commit changes the behaviour of gentoo between 2.6.32 and 2.6.33 (for me):

commit 3d23e349d807177eaf519d444677cee86b1a04cf
Author: Johannes Berg <johannes@sipsolutions.net>
Date:   Tue Sep 29 23:27:28 2009 +0200

    wext: refactor
    
    Refactor wext to
     * split out iwpriv handling
     * split out iwspy handling
     * split out procfs support
     * allow cfg80211 to have wireless extensions compat code
       w/o CONFIG_WIRELESS_EXT
    
    After this, drivers need to
     - select WIRELESS_EXT	- for wext support
     - select WEXT_PRIV	- for iwpriv support
     - select WEXT_SPY	- for iwspy support
    
    except cfg80211 -- which gets new hooks in wext-core.c
    and can then get wext handlers without CONFIG_WIRELESS_EXT.
    
    Wireless extensions procfs support is auto-selected
    based on PROC_FS and anything that requires the wext core
    (i.e. WIRELESS_EXT or CFG80211_WEXT).
    
    Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
    Signed-off-by: John W. Linville <linville@tuxdriver.com>

 drivers/net/wireless/Kconfig         |   29 +-
 drivers/net/wireless/hostap/Kconfig  |    2 +
 drivers/net/wireless/ipw2x00/Kconfig |    5 +
 drivers/net/wireless/orinoco/Kconfig |    2 +
 include/net/cfg80211.h               |    6 +-
 include/net/iw_handler.h             |   14 +-
 include/net/net_namespace.h          |    2 +-
 include/net/wext.h                   |   49 +-
 net/core/net-sysfs.c                 |    6 +-
 net/socket.c                         |    4 +-
 net/wireless/Kconfig                 |   50 +-
 net/wireless/Makefile                |    8 +-
 net/wireless/core.c                  |   14 +-
 net/wireless/ibss.c                  |   10 +-
 net/wireless/mlme.c                  |    2 +-
 net/wireless/nl80211.c               |    4 +-
 net/wireless/scan.c                  |    6 +-
 net/wireless/sme.c                   |   12 +-
 net/wireless/wext-core.c             | 1063 ++++++++++++++++++++
 net/wireless/wext-priv.c             |  248 +++++
 net/wireless/wext-proc.c             |  155 +++
 net/wireless/wext-spy.c              |  231 +++++
 net/wireless/wext.c                  | 1775 ----------------------------------
 23 files changed, 1850 insertions(+), 1847 deletions(-)
Comment 11 Jan Buecken 2010-06-11 12:50:17 UTC
Created attachment 234945 [details]
git bisect log between 2.6.32 (good) and 2.6.33 (bad)
Comment 12 Markos Chandras (RETIRED) gentoo-dev 2010-06-11 16:14:03 UTC
This has to be reported upstream since it is not related to gentoo-sources explicitely :)

Please open a bug on http://bugzilla.kernel.org and post here the link of the upstream bug

Thank you for you time on performing a git bisect . It will be really helpfull to upstream developers
Comment 13 Jan Buecken 2010-06-13 17:52:28 UTC
(In reply to comment #12)
> This has to be reported upstream since it is not related to gentoo-sources
> explicitely :)

IMHO, this is a gentoo bug, because gentoo does not start the correct script anymore! It seems to me that gentoo "believe" that "wlan0" is an ethernet device, and not an wirless device. Thus gentoo starts ifplugd and not wpa_supplicant. 
It is not a kernel bug if they change their architecture. The driver (ath5k) works with iwconfig/ifconfig.

Comment 14 Jan Buecken 2010-06-28 12:09:42 UTC
Further informations: Tried drm-radeon-testing (based on 2.6.35-rc3, don't think that stable vanilla behaves different)

As I said, ifplugd is started on wlan0 instead of wpa_supplicant and dhcpd.
Kernel log says: 

ifplugd(wlan0): Initialization complete, link beat not detected.

Now I started the wpa_supplicant manually and enabled a network: 
Surprisingly ifplugd now detects a link beat and tries to start wpa_supplicant, too! But now two wpa_supplicant are running and thus, wlan0 gets a connect and disconnect event alternating (this bug can be reproduced with to instances of wpa_supplicant on a 2.6.32).

Thus I restarted wlan0 with the init script and killed ifplugd with

$iflugd -i wlan0 -k

Then started wpa_supplicant again and tried to connect, but I had to run 

$dhcpd wlan0

extra, otherwise I did not get an IP. With this set-up, wlan works.

Thus two questions rise up:

Is it corecct that ifplugd starts on wlan devices (does not make sense for me)?
Is it possible to force link beat detection on wirless devices? (This could be a workaround, since ifplugd seems to start the right things after link beat detection)
Comment 15 Jan Essert 2010-07-05 12:13:30 UTC
(In reply to comment #12)
> This has to be reported upstream since it is not related to gentoo-sources
> explicitely :)

I also do not think this is a kernel bug. As I said, I can start wpa_supplicant and dhcpcd manually and everything works fine.

I am also on a baselayout-2 system and not on baselayout-1. I assume that the way wireless devices are reported in the kernel has changed. This is probably an openrc bug?

I will provide additional information if you tell me what you need. This is quite annoying, since I have to start the network manually on every boot and many services cannot start due to the unsatisfied net dependency.

Perhaps there is a kernel configuration option which needs to be set in order for openrc to properly detect the wireless device?
Comment 16 Jan Essert 2010-07-07 07:36:04 UTC
Sorry, about the noise, I probably have been hit by bug #277594 instead. I will check this tonight.
Comment 17 Jan Essert 2010-07-09 08:09:37 UTC
yeah, sorry, I obviously commented on the wrong bug, so ignore everything I said here. My problem is solved using the workaround from bug #277594.
Comment 18 zdzlz15 2010-07-15 00:18:39 UTC
I'm having this problem too.

Under gentoo-sources-2.6.32, "net.wlan0 start" starts wpa_supplicant as expected:

 * Starting wlan0
 *   Starting wpa_supplicant on wlan0 ...
[ ok ]
 *   Starting wpa_cli on wlan0 ...
[ ok ]
[ ok ]
 *     Backgrounding ...


But with gentoo-sources-2.6.33+, it tries to run netplug (which should never happen with a wireless interface), and wpa_supplicant never gets started:

 * Starting wlan0
 *   Starting netplug on wlan0 ...
[ ok ]
 *     Backgrounding ...

and I wind up with two netplugd processes running.


Killing the new netplugd process and manually starting wpa_supplicant and dhcpcd gets me a working network.

I'm using baselayout-1, like Jan Buecken, but I have netplug installed instead of ifplugd.
Comment 19 Jan Buecken 2010-07-28 09:31:06 UTC
NEW INFO: sysfs is involved:

In bug #277594 , comment 277594#c18 Denis decribe a workaround. The problem is:
/lib/rcscripts/net/wpa_supplicant.sh
looks in function
wpa_supplicant_exists
for an entry in
/proc/net/wireless
but its empty, or it looks for 
/sys/class/net/$1/wireless 
but this directory was not generatet on my system. Thus, Denis workaround to use /proc/net/dev instead /proc/net/wireless fixed it. But the real fix should be that sysfs / ath5k or whatever creates the wirless directory in 
/sys/class/net/wlan0/.

I'll find out if this file exists with the 2.6.32 kernel.
Comment 20 Jan Buecken 2010-07-28 09:40:57 UTC
(In reply to comment #19)
> But the real fix should
> be that sysfs / ath5k or whatever creates the wirless directory in 
> /sys/class/net/wlan0/.
> 
> I'll find out if this file exists with the 2.6.32 kernel.
> 

No, the wireless file does not exist with 2.6.32.9 vanilla. But
/proc/net/wireless
has the wlan0 entry.
Comment 21 Jan Buecken 2010-07-28 12:23:57 UTC
Denis just posted a second (IMHO better) workaround:

Turning on CONFIG_WIRELESS_EXT_SYSFS kernel option works for me 
(then you don't need to edit /lib/rcscripts/net/wpa_supplicant.sh)

But the kernel-help says that CONFIG_WIRELESS_EXT_SYSFS is deprecated.

Is it now a problem with wpa_supplicant, kernel or gentoo that /proc/net/wireless is empty? 
Should the wpa_supplicant.sh script check /proc/net/dev?
What is a real fix and not a workaround (with deprecated files...)?

greetings
Comment 22 Jimmy C. Chau 2010-09-03 22:28:15 UTC
This workaround did the trick for me.  Thanks!  (Now I can continue installing Gentoo on my computer :)

(In reply to comment #21)
> Denis just posted a second (IMHO better) workaround:
> 
> Turning on CONFIG_WIRELESS_EXT_SYSFS kernel option works for me 
> (then you don't need to edit /lib/rcscripts/net/wpa_supplicant.sh)
> 
> But the kernel-help says that CONFIG_WIRELESS_EXT_SYSFS is deprecated.
> 
> Is it now a problem with wpa_supplicant, kernel or gentoo that
> /proc/net/wireless is empty? 
> Should the wpa_supplicant.sh script check /proc/net/dev?
> What is a real fix and not a workaround (with deprecated files...)?
> 
> greetings
> 

Comment 23 Marvin Vek 2010-11-07 23:59:57 UTC
(In reply to comment #21)
> Denis just posted a second (IMHO better) workaround:
> 
> Turning on CONFIG_WIRELESS_EXT_SYSFS kernel option works for me 
> (then you don't need to edit /lib/rcscripts/net/wpa_supplicant.sh)
> 
> But the kernel-help says that CONFIG_WIRELESS_EXT_SYSFS is deprecated.
> 
> Is it now a problem with wpa_supplicant, kernel or gentoo that
> /proc/net/wireless is empty? 

Has nothing to do with wpa_supplicant, nor the kernel. The wpa_supplicant.sh script mentioned above is checking for the deprecated /proc/net/wireless, so that's where the problem is. Wicd on Launchpad confirmed this as well: https://bugs.launchpad.net/wicd/+bug/415719/comments/5. I'm way too lazy to find the kernel diff on it.

Another workaround, is to put the following in /etc/conf.d/net, so it starts cause you called -D wired, and added another -D with the actual driver you need. Here, wpa_supplicant moves on to use the nl80211 for example:

wpa_supplicant_wlan0="-D wired -D nl80211"
Comment 24 Ilia Pozhilov 2010-11-18 23:29:07 UTC
Yet another workaround here (the cleanest of all mentioned imho):
add "!plug" into the modules line in the /etc/conf.d/net
In my case I changed from
modules_wlan0="wpa_supplicant" 
to
modules_wlan0="wpa_supplicant !plug" 

enjoy!
Comment 25 Jeremy Murphy 2011-02-19 09:30:07 UTC
Pretty sure that this is a duplicate of #311803.
Comment 26 Jeremy Murphy 2011-02-19 10:21:30 UTC
UNLESS... and I strongly recommend this: we make this bug specifically for baselayout-1, because #311803 is specifically baselayout-2.  And I would love to see baselayout-1 fixed.  In which case this bug's summary should probably be changed to:

sys-apps/baselayout-1: wpa_supplicant.sh fails to find wireless interface on >=gentoo-sources-2.6.33

A little bit long, but I think it's appropriate.  And best of all, I think the fix is trivial: the script just has to look for the "phy80211" directory in addition to "wireless" and "wiphy" in /sys/class/net/<if>.  Thanks to Jan Buecken for shedding most of the light on that.

What do the rest of you (especially baselayout team) think?
Comment 27 Jeremy Murphy 2011-02-19 10:25:35 UTC
Sorry for the noise, but actually the summary should be:

sys-apps/baselayout-1: wpa_supplicant.sh fails to find nl80211 interface on >=gentoo-sources-2.6.33

Since it can of course find interfaces that have Wireless Extensions enabled.
Comment 28 Alan Swanson 2011-02-19 16:34:39 UTC
Just encountered this after changing from ipw2200 to ath9k. The problem is that /proc/net/wireless is not populated until after the interface is associated and not just ifconfig up'd AFIACT. Adding "phy80211" to wpa_supplicant.sh fixes issue for me.
Comment 29 Jan Buecken 2011-02-19 20:00:59 UTC
(In reply to comment #26)
> UNLESS... and I strongly recommend this: we make this bug specifically for
> baselayout-1, because #311803 is specifically baselayout-2.  And I would love
> to see baselayout-1 fixed.  In which case this bug's summary should probably be
> changed to:
> 
> sys-apps/baselayout-1: wpa_supplicant.sh fails to find wireless interface on
> >=gentoo-sources-2.6.33
> 

This bug is independent from the baselayout version. It should appear on baselayout-1 and 2. Thus bug #311803 could be a dublicate from this bug or from bug #277594. Note that 277594 and this bug are independent!

Comment 30 Jeremy Murphy 2011-02-20 02:15:33 UTC
(In reply to comment #29)
> 
> This bug is independent from the baselayout version. It should appear on
> baselayout-1 and 2. Thus bug #311803 could be a dublicate from this bug or from
> bug #277594. Note that 277594 and this bug are independent!

I think it is dependent on baselayout-1, because baselayout-2 uses openrc scripts that look for phy80211, not wiphy, which works for kernel >=2.6.33.

I'm not quite sure what is going on in #311803 because as I pointed out in that bug, wpa_supplicant does start.  #277594 may actually be a bug in wpa_supplicant but probably needs to be retested with the latest packages.

Now that I've looked at a bunch of wpa_supplicant/baselayout bugs, I think this one is actually a duplicate of #307191.
Comment 31 Jan Buecken 2011-02-20 17:12:57 UTC
(In reply to comment #30)

> Now that I've looked at a bunch of wpa_supplicant/baselayout bugs, I think this
> one is actually a duplicate of #307191.

Yes, seems to be the same reason.

> I'm not quite sure what is going on in #311803 because as I pointed out in
> that bug, wpa_supplicant does start.

I'm on baselayout-2 now, but I remember that wpa_supplicant started without the init script. I had to start it by hand with the command. But wpa_supplicant didn't work, the deamon was listet in (h)top.

*** This bug has been marked as a duplicate of bug 307191 ***