Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 311803 - sys-apps/openrc and net-wireless/wpa_supplicant have problem with nl80211 driver
Summary: sys-apps/openrc and net-wireless/wpa_supplicant have problem with nl80211 driver
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: OpenRC (show other bugs)
Hardware: All Linux
: High normal
Assignee: OpenRC Team
URL:
Whiteboard: openrc:oldnet:wpa_supplicant
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-28 17:24 UTC by Jiří Moravec
Modified: 2012-08-26 02:56 UTC (History)
8 users (show)

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


Attachments
wpa_supplicant-1 log (wpa-1,4.37 KB, text/plain)
2012-08-15 16:47 UTC, Kyle Evans
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jiří Moravec 2010-03-28 17:24:25 UTC
I have installed sys-apps/baselayout-2.0.1, sys-apps/openrc-0.6.1, net-wireless/wpa_supplicant-0.7.1. Running kernel has NO WIRELESS_EXT support, nl80211 only!

/etc/conf.d/wpa_supplicant:
wpa_supplicant_args="-Dnl80211"

/etc/init.d/net.wlan0 start failed with:
 * Bringing up interface wlan0
 *   Starting wpa_supplicant on wlan0 ...
ioctl[SIOCSIWPMKSA]: Invalid argument
ioctl[SIOCSIWMODE]: Invalid argument
ioctl[SIOCGIWRANGE]: Invalid argument
ioctl[SIOCGIWMODE]: Invalid argument
ioctl[SIOCSIWAP]: Invalid argument
ioctl[SIOCSIWENCODEEXT]: Invalid argument
ioctl[SIOCSIWENCODEEXT]: Invalid argument
ioctl[SIOCSIWENCODEEXT]: Invalid argument
ioctl[SIOCSIWENCODEEXT]: Invalid argument
ioctl[SIOCSIWPMKSA]: Invalid argument
 *   Starting wpa_cli on wlan0 ...                       [ ok ]
 *   Backgrounding ... ...                               [ ok ]
 * WARNING: net.wlan0 has started, but is inactive
wifi link is of course dead.

When I started interface manually without net script:
~ # ip link set dev wlan0 up
~ # /etc/init.d/wpa_supplicant start
~ # ip addr add $ADDRESS dev wlan0 brd +
~ # ip route add default via $GWADDRESS
then wpa_supplicant started cleanly and wifi connection running without any problems. But only with wpa_supplicant-0.7.1.

When wpa_supplicant-0.6.10 is installed manual start ended with:
 * Caching service dependencies ...                      [ ok ]
 * Stopping WPA Supplicant Daemon ...                    [ ok ]
 * Starting WPA Supplicant Daemon ...
ioctl[SIOCSIWPMKSA]: Invalid argument
ioctl[SIOCGIWRANGE]: Invalid argument
ioctl[SIOCSIWPMKSA]: Invalid argument                    [ ok ]
and wifi link is dead again.

It looks like /etc/init.d/net script have some problems with handling wireless networks without WIRELESS_EXT. Am I only one affected?
Comment 1 Panagiotis Christopoulos (RETIRED) gentoo-dev 2010-04-07 08:22:42 UTC
Please paste your emerge --info output.
Comment 2 Bjarke Istrup Pedersen (RETIRED) gentoo-dev 2010-04-07 10:05:41 UTC
Since wpa_supplicant works, this seems more like a bug in openrc than a bug in wpa_supplicant.
Comment 3 Roy Marples 2010-04-07 10:20:02 UTC
How can I tell if the interface is wireless or not using nl80211 only?

Here's the current code:

       [ -d /sys/class/net/"${IFACE}"/wireless -o \
                -d /sys/class/net/"${IFACE}"/phy80211 ] && return 0

        [ ! -e /proc/net/wireless ] && return 1
        grep -Eq "^[[:space:]]*${IFACE}:" /proc/net/wireless
Comment 4 Bjarke Istrup Pedersen (RETIRED) gentoo-dev 2010-04-09 21:01:27 UTC
Roy, so what you are saying is, that it's a problem with the /etc/ini.d/net init script, or am I misunderstanding you? :)
Comment 5 Roy Marples 2010-04-09 21:53:40 UTC
No, it's a problem with how the kernel says if an interace is wireless or not - each way does it differently. The OP is just using one way, which I don't have the hardware for, so cannot test, hence me asking how I can tell if the interface is wireless or not.
Comment 6 Bjarke Istrup Pedersen (RETIRED) gentoo-dev 2010-04-10 12:11:19 UTC
Not sure really - might be an idea to check how the "iw" tool does it.

I just tried this on my router:
(for a wireless interface) :
# iw dev wlan0 info
Interface wlan0
        ifindex 6
        type AP

(for a normal ethernet port) :
# iw dev wan0 info
command failed: No such device (-19)

So clearly the iw tool has code for detecting if an interface is wireless or not using nl80211 :-)
Comment 7 Roy Marples 2010-04-10 13:51:55 UTC
That's nice, but I'd like to do it using shell.
Comment 8 Bjarke Istrup Pedersen (RETIRED) gentoo-dev 2010-04-11 08:37:21 UTC
I'm afraid I haven't got any ideas then (except calling iw and pass the return code) :-)
Comment 9 Jiří Moravec 2010-04-12 10:10:23 UTC
/sys/class/net/"${IFACE}"/phy80211 presence is not sufficient?
Comment 10 Roy Marples 2010-04-12 10:54:37 UTC
(In reply to comment #9)
> /sys/class/net/"${IFACE}"/phy80211 presence is not sufficient?

Unless I'm reading this bug wrong its not, no.
Comment 11 PetaMem R&D 2010-09-10 06:45:21 UTC
(In reply to comment #1)
> It looks like /etc/init.d/net script have some problems with handling wireless
> networks without WIRELESS_EXT. Am I only one affected?

Same here - since the update to 2.6.35 kernel. 2.6.31 works (with otherwise identical openrc,wpa_supplicant)

baselayout 2.0.1
openrc 0.6.3
Comment 12 Jan Buecken 2011-02-19 20:04:48 UTC
(In reply to comment #11)
> (In reply to comment #1)
> > It looks like /etc/init.d/net script have some problems with handling wireless
> > networks without WIRELESS_EXT. Am I only one affected?
> 
> Same here - since the update to 2.6.35 kernel. 2.6.31 works (with otherwise
> identical openrc,wpa_supplicant)
> 
> baselayout 2.0.1
> openrc 0.6.3
> 

Could you make sure you don't run in bug #321663. Has this bug something to do with 277594? 

Does the solutions in 277594 or 321663 help here?
Comment 13 Jeremy Murphy 2011-02-20 01:37:53 UTC
I don't think this is a duplicate of #307191 (of which #321663 is a duplicate), because that bug is where wpa_supplicant does not start at all.

However, since the OP has not provided emerge --info or relevant kernel config options (like what the network device is), we're just guessing until they do.  	Jiří, please post an updated bug report that uses the latest version of the relevant packages.

By the way, a quick glance at the iw source code shows that it is using /sys/class/ieee80211/<phyname>/index.

Since /sys/class/net/<if>/phy80211 is a link to /sys/class/ieee80211/<phyname>, I would predict that for modern kernels (>=2.6.33) it's reliable.
Comment 14 Jan Buecken 2011-02-20 23:52:52 UTC
(In reply to comment #11)
> (In reply to comment #1)
> > It looks like /etc/init.d/net script have some problems with handling wireless
> > networks without WIRELESS_EXT. Am I only one affected?
> 
> Same here - since the update to 2.6.35 kernel. 2.6.31 works (with otherwise
> identical openrc,wpa_supplicant)
> 
> baselayout 2.0.1
> openrc 0.6.3
> 

AH! I believe I know why you run into this problem:
WIRELESS_EXT is now CFG80211_WEXT. Is it enabled?
I could exactly reproduce this bug after disabling CFG80211_WEXT
(baselayout 2.0.1, openrc 0.6.3)
Comment 15 Jan Buecken 2011-02-21 00:41:20 UTC
(In reply to comment #3)
> How can I tell if the interface is wireless or not using nl80211 only?
> 
> Here's the current code:
> 
>        [ -d /sys/class/net/"${IFACE}"/wireless -o \
>                 -d /sys/class/net/"${IFACE}"/phy80211 ] && return 0
> 
>         [ ! -e /proc/net/wireless ] && return 1
>         grep -Eq "^[[:space:]]*${IFACE}:" /proc/net/wireless
> 

Hey Roy, I think Jiří is right: The file /sys/class/net/wlan0/phy80211 exists with and without CFG80211_WEXT in kernel. Thus in theorie, this code should be sufficient.

I just recognized something: If I disable CFG80211_WEXT, then iwconfig says wlan0 is not a wirless extension. Can someone confirm this (maybe a new bug in iwconfig)? (tested with drm-radeon-testing kernel from Dave Airlies git repo, almost a vanilla 2.6.38-rc5)
Comment 16 Jeremy Murphy 2011-02-21 06:38:53 UTC
(In reply to comment #15)
> 
> I just recognized something: If I disable CFG80211_WEXT, then iwconfig says
> wlan0 is not a wirless extension. Can someone confirm this (maybe a new bug in
> iwconfig)? (tested with drm-radeon-testing kernel from Dave Airlies git repo,
> almost a vanilla 2.6.38-rc5)

That's not a bug, that's just iwconfig confirming that you disabled Wireless Extensions for that interface.  (And so iwconfig can't talk to it -- you need net-wireless/iw, which speaks "nl80211": http://linuxwireless.org/en/developers/Documentation/cfg80211).
Comment 17 Jeremy Murphy 2012-02-06 02:29:01 UTC
I just made a new install of Gentoo on a laptop and hit this bug.  However, I think it's not actually a bug at all, I just made the same mistake as Jiří: I configured wpa_supplicant via /etc/conf.d/wpa_supplicant but I used /etc/init.d/net.wlan0!  The correct way to configure it is via /etc/conf.d/net, just like the Gentoo wireless manual instructs.
Comment 18 Kyle Evans 2012-08-15 16:47:10 UTC
Created attachment 321406 [details]
wpa_supplicant-1 log
Comment 19 Kyle Evans 2012-08-15 16:49:34 UTC
Comment on attachment 321406 [details]
wpa_supplicant-1 log

wrong bug
Comment 20 Jeremy Murphy 2012-08-16 12:01:11 UTC
Is this actually a bug?  Didn't the OP misconfigure their wireless network?  I suspect that it can be closed, but some more comments from nl80211-only users might be warranted.  It works fine for me.
Comment 21 Benda Xu gentoo-dev 2012-08-26 02:56:58 UTC
Hi, all. From Jeremy comment, and my own test on openrc-0.10 git and wpa_supplicant v1.0 using nl80211. This bug seems not to be reproducible now.

I'd like to close it. Feel free to reopen it if there are issues that I've been missed.

Thanks a lot.