Bug 625403

Summary: Wireless networking with ifup and WPA/WPA2 and most drivers that do not use mac80211 fail
Product: [openSUSE] openSUSE 11.3 Reporter: Larry Finger <Larry.Finger>
Component: NetworkAssignee: Vladimir Botka <vbotka>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: enderandrew, mike, mt, nospam.novell, v.plessky
Version: Final   
Target Milestone: ---   
Hardware: All   
OS: openSUSE 11.3   
Whiteboard: maint:released:11.3:35314
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Deadline: 2010-09-16   
Attachments: Patch to fix ifup-wireless
Patch (V2) to fix ifup-wireless
scripts/ifup-wireless: WPA driver cleanup mt1
Adds adm8211,mwl8k,wl1251,wl1271 drivers to ifup-wireless.mt1
scripts/ifup-wireless: WPA driver cleanup mt2
scripts/ifup-wireless: WPA driver cleanup mt3
The git patch for comment 14
Updated git patch for comment 14

Description Larry Finger 2010-07-25 19:56:47 UTC
Created attachment 378229 [details]
Patch to fix ifup-wireless

User-Agent:       Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.6) Gecko/20100626 SUSE/3.6.6-1.2 Firefox/3.6.6

When ifup is used to control a wireless connection using WPA/WPA2 and the driver does not use mac80211, the script /etc/sysconfig/network/scripts/ifup-wireless selects nl80211 as WPA_DRIVER. The connection fails because wpa_supplicant cannot communicate with the driver.

A patch to fix the problem is in the attachment. It adds missing mainline drivers to the code that sets WPA_DRIVER and makes the default for unknown drivers be wext, not nl80211.

Reproducible: Always

Steps to Reproduce:
1.
2.
3.
Comment 1 Larry Finger 2010-07-28 13:16:47 UTC
Created attachment 378880 [details]
Patch (V2) to fix ifup-wireless

Since the original attachment was sent, the same problem was discovered to affect the ipw2100 and ipw2200 drivers. See http://forums.opensuse.org/english/get-help-here/wireless/443030-wireless-failing-start-thinkpad-x40.html.

V2 of the patch fixes this problem.
Comment 2 Vladimir Botka 2010-07-28 17:00:33 UTC
Thank you for the patch. I've forwarded it to the maintainer of sysconfig.

I've changed the default assignment slightly [2]. There is one convenient feature of wpa_supplicant. wpa_supplicant can handle more wlan drivers on the commandline (-Dnl80211,wext). If nl80211 is not available then wext is used. I've tested this feature with ipw2200 and it works. You can see messages in the wpa_supplicant.log [1].


[1]
1280324454.719843: nl80211: Driver does not support authentication/association or connect commands
1280324454.719871: Failed to initialize driver interface - try next driver wrapper
1280324454.719923: WEXT: cfg80211-based driver detected

[2]
-                WPA_DRIVER=nl80211
+                WPA_DRIVER=nl80211,wext
Comment 3 Larry Finger 2010-07-28 17:43:19 UTC
That is a good addition. Thanks for the attention to this problem.
Comment 4 Vladimir Botka 2010-07-29 13:58:08 UTC
*** Bug 625411 has been marked as a duplicate of this bug. ***
Comment 5 Marius Tomaschewski 2010-08-13 08:10:25 UTC
Created attachment 382781 [details]
scripts/ifup-wireless: WPA driver cleanup mt1

Larry,
thanks for your patches and bug report!!

Above is my current version of ifup-wireless script. I've applied your
attached patch and also sorted the drivers by driver and by name a bit...

I'd like to verify the nl80211 list before I commit it and we need a next
patch. It seems, there are some drivers that we didn't catched yet, e.g.
the adm8211 or mwl8 driver:

depmatch='^depends:.*mac80211'
for f in $(find /lib/modules/`uname -r`/kernel/drivers/net/wireless/ -name "*.ko") ; do b=$(echo $f | sed -e "s/.*\/net\/wireless\///g") ; /sbin/modinfo $f | grep -qs $depmatch && echo "$b" ; done | sort

adm8211.ko
at76c50x-usb.ko
ath/ar9170/ar9170usb.ko
ath/ath5k/ath5k.ko
ath/ath9k/ath9k.ko
b43/b43.ko
b43legacy/b43legacy.ko
iwlwifi/iwl3945.ko
iwlwifi/iwlagn.ko
iwlwifi/iwlcore.ko
libertas_tf/libertas_tf.ko
mac80211_hwsim.ko
mwl8k.ko
p54/p54common.ko
p54/p54pci.ko
p54/p54spi.ko
p54/p54usb.ko
rt2x00/rt2x00lib.ko
rt2x00/rt2x00pci.ko
rt2x00/rt2x00usb.ko
rtl818x/rtl8180.ko
rtl818x/rtl8187.ko
wl12xx/wl1251.ko
wl12xx/wl1251_sdio.ko
wl12xx/wl1251_spi.ko
wl12xx/wl1271.ko
zd1211rw/zd1211rw.ko

AFAIS not all drivers have a clear mac80211 dependency, e.g. has:
   rt61pci -> rt2x00lib -> mac80211

$ for m in rt61pci ; do echo -n "$m " ; /sbin/modinfo $m | grep -E "^depends:" ; done
rt61pci depends:        rt2x00lib,rt2x00pci,eeprom_93cx6,crc-itu-t
$ for m in rt2x00lib rt2x00pci eeprom_93cx6 crc-itu-t ; do echo -n "$m " ; /sbin/modinfo $m | grep -E "^depends:" ; done
rt2x00lib depends:        mac80211,led-class,cfg80211
rt2x00pci depends:        rt2x00lib,mac80211
eeprom_93cx6 depends:        
crc-itu-t depends:        

Vladimir should be back next week and we'll verify/complete the mapping
and go to release it then.
Comment 6 Marius Tomaschewski 2010-08-13 08:12:49 UTC
Created attachment 382783 [details]
Adds adm8211,mwl8k,wl1251,wl1271 drivers to ifup-wireless.mt1

Adds adm8211,mwl8k,wl1251,wl1271 drivers to ifup-wireless.mt1 as described
in the comment above.
Comment 7 Larry Finger 2010-08-14 21:15:39 UTC
Script and patch look good. When new drivers are added, the "nl80211,wext" choice for unsupported will do the right thing. Only the bogus "WPA may not be supported" message will be output.
Comment 8 Marius Tomaschewski 2010-08-16 07:02:50 UTC
OK, thanks!
A notice is intentional here and I'd prefer to keep it. But we can change
it a bit, for example to "untested":


     if [ "$WPA_DRIVER" = "unsupported" ]; then
-        message "`printf "    %-9s warning: WPA configured but may be unsupported" $INTERFACE`"
-        message "`printf "    %-9s warning: by this device" $INTERFACE`"
-        info_mesg "using WPA drivers 'nl80211,wext' for interface $INTERFACE"
-        info_mesg "when you notice problems with this new driver, set " \
-                  "e.g. WIRELESS_WPA_DRIVER='wext' and file a bug report."
-        info_mesg "see also driver list in the /usr/sbin/wpa_supplicant -h output"
-        WPA_DRIVER="nl80211,wext"
+        message "`printf "    %-9s warning: WPA configured, but is untested" $INTERFACE`"
+        message "`printf "    %-9s warning: with this device" $INTERFACE`"
+        info_mesg "Using WPA drivers 'nl80211,wext' for interface $INTERFACE."
+        info_mesg "When you notice problems with the 'nl80211' driver, set "
+       info_mesg "e.g. WIRELESS_WPA_DRIVER='wext' and file a bug report."
+        info_mesg "See drivers list in the /usr/sbin/wpa_supplicant -h output"
+        WPA_DRIVER='nl80211,wext'
     fi
Comment 9 Marius Tomaschewski 2010-08-16 07:14:21 UTC
Created attachment 383070 [details]
scripts/ifup-wireless: WPA driver cleanup mt2

Added textual changes from comment above, mapping for libertas*:
libertas*)         WPA_DRIVER=nl80211

and changed ndiswrapper to nl80211,wext -- "wext" only?
ndiswrapper|*.sys) WPA_DRIVER=nl80211,wext
Comment 10 Larry Finger 2010-08-16 12:56:35 UTC
The Windows drivers will have no knowledge of nl80211. They should be wext only as the nl80211 option will fail. We might as well save the time and the failure line.

I like the new wording regarding wext usage of wpa_supplicant as untested. In most cases it will work, and the user is less likely to be scared off by the message.
Comment 12 Marius Tomaschewski 2010-08-17 08:11:08 UTC
Created attachment 383374 [details]
scripts/ifup-wireless: WPA driver cleanup mt3

Maps ndiswrapper to wext.
Comment 13 Marius Tomaschewski 2010-08-17 14:03:43 UTC
FYI: The patches are applied in git and to my current test package at:

http://download.opensuse.org/repositories/home:/mtomaschewski:/branches:/openSUSE:/11.3:/Update:/Test/openSUSE_11.3_Update_Test/

Vladimir,
please take a look and let me know / send patch when there is still
something.
Comment 14 Vladimir Botka 2010-08-18 09:47:57 UTC
(In reply to comment #13)
> Vladimir,
> please take a look and let me know / send patch when there is still
> something.

I've added 2 more changes [2]. Only ath9k driver works with nl80211 [1] and Intel 4965 support was integrated into the iwlagn. I've also removed the ipw3945 duplicity.

[1] https://bugzilla.novell.com/show_bug.cgi?id=621412#c15

[2]
# diff ifup-wireless.orig ifup-wireless
741c741,744
<             ath5k|ath9k|ath_pci)
---
>             ath5k|ath_pci)
>                 WPA_DRIVER=wext
>                 ;;
>             ath9k)
750c753
<             iwlagn|iwl3945|iwl4965|ipw3945)
---
>             iwlagn|iwl3945)
Comment 15 Marius Tomaschewski 2010-08-18 11:10:02 UTC
Created attachment 383740 [details]
The git patch for comment 14
Comment 16 Marius Tomaschewski 2010-08-18 11:43:38 UTC
Created attachment 383757 [details]
Updated git patch for comment 14

Reverted ath5k change to wext:

/sbin/modinfo ath5k | grep depends
depends:        mac80211,led-class,cfg80211,ath

It works fine with nl80211 for me.
Comment 17 Marius Tomaschewski 2010-08-18 12:39:55 UTC
I've updated home:mtomaschewski:branches:openSUSE:11.3:Update:Test/sysconfig
and submitted it to openSUSE:11.3:Update:Test in request 45757. Changelog is:

-------------------------------------------------------------------
Wed Aug 18 12:13:26 UTC 2010 - mt@suse.de

- Fixed wireless hardware to wext/nl80211 WPA driver mapping.
  Changed to use -Dnl80211,wext by default for untested drivers
  to let the wpa_supplicant fallback to wext when nl80211 is not
  available. Adjusted info message about untested drivers and
  enabled untested driver handling also in case wpa_supplicant
  is not required but the user prefers to use it (bnc#623340,
  #623676,#624182,#625403,#631283). Thanks to all reporters,
  especially to Larry Finger and Vladimir Botka!

-------------------------------------------------------------------
Mon Jul 12 11:12:21 UTC 2010 - mt@suse.de

- Fixed check whether ipv6 is enabled or not in /sbin/ifup-dhcp to
  avoid dhcpv6 client start in case the interface is configured to
  start both, dhcpv4 and dhcpv6 clients (bnc#616765).

-------------------------------------------------------------------
Comment 19 Swamp Workflow Management 2010-08-19 18:16:22 UTC
The SWAMPID for this issue is 35308.
This issue was rated as low.
Please submit fixed packages until 2010-09-16.
Also create a patchinfo file using this link:
https://swamp.suse.de/webswamp/wf/35308
Comment 21 Christian Dengler 2010-08-19 18:18:12 UTC
update started, be so kind and submit a patchinfo.
Comment 22 Marius Tomaschewski 2010-08-20 07:24:38 UTC
patchinfo submitted -- twice: could you delete workflowid 35313? thanks!
Comment 25 Swamp Workflow Management 2010-09-07 12:52:43 UTC
Update released for: sysconfig, sysconfig-debuginfo, sysconfig-debugsource
Products:
openSUSE 11.3 (debug, i586, x86_64)
Comment 26 Tony Jones 2010-09-24 21:52:47 UTC
*** Bug 604095 has been marked as a duplicate of this bug. ***
Comment 27 Vadim Plessky 2010-09-25 12:36:59 UTC
Hello,

Two questions
1) Update released for: sysconfig, sysconfig-debuginfo, sysconfig-debugsource
  What are exact version numbers for corresponding RPMs?

2) I also have problem with slow connection for Intel wireless adapter
  Speed is about 1Bmps in Linux, while it is 54Mbit in Windows.
OpenSUSE 11.3 has been updated (#zypper up) yesterday, 25.09.10
Should I file separate bug report, or I can submit details to this bug report?
Comment 28 Vadim Plessky 2010-09-25 14:56:54 UTC
Latest update from OpenSUSE 11.3 repository:
  sysconfig-0.73.7-2.1.1
Build date: 23 August 2010

It seems updates released on 2010-09-07 are still not available in repos.
Comment 29 Marius Tomaschewski 2010-09-27 10:03:48 UTC
(In reply to comment #27)
> Hello,
> 
> Two questions
> 1) Update released for: sysconfig, sysconfig-debuginfo, sysconfig-debugsource
>   What are exact version numbers for corresponding RPMs?

sysconfig-0.73.7-2.1.1

(In reply to comment #28)
> Latest update from OpenSUSE 11.3 repository:
>   sysconfig-0.73.7-2.1.1
> Build date: 23 August 2010
>
> It seems updates released on 2010-09-07 are still not available in repos.

They are. 2010-09-07 is the release / availability date of the package.
See also "rpm -q --changelog sysconfig" and comment 17.

There is always some time between the submit request, commit, build date
and the release, because all changes/updates are reviewed multiple times
by our autobuild, maintenance and qa teams.
The submit request is from 18.Aug, it has been reviewed and accepted [for Update:Test project] on 23.Aug. Then the packages are built&signed, go
into review again and when all is fine, they're released [moved to the
"Update" project] on 7.Sep.

See also "osc rq show 45757" output and comments 19 .. 22 + 25 above.

> 2) I also have problem with slow connection for Intel wireless adapter
>   Speed is about 1Bmps in Linux, while it is 54Mbit in Windows.
> OpenSUSE 11.3 has been updated (#zypper up) yesterday, 25.09.10
> Should I file separate bug report, or I can submit details to this bug report?

Please file a separate bug report.