Ubuntu

network-manager and ndiswrapper are not friends

Reported by Scott Robinson on 2006-10-04
4
Affects Status Importance Assigned to Milestone
network-manager (Ubuntu)
High
Tollef Fog Heen

Bug Description

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

 affects distros/ubuntu/network-manager
 subscribe ubuntu-universe-sponsors

reverted:
- --- network-manager-0.6.3/debian/patches/10-rml-wpa-workarounds.patch
+++ network-manager-0.6.3.orig/debian/patches/10-rml-wpa-workarounds.patch
@@ -1,95 +0,0 @@
- ---- src/nm-device-802-11-wireless.c~ 2006-07-12 22:09:25.000000000 +0100
- -+++ src/nm-device-802-11-wireless.c 2006-07-12 22:09:27.000000000 +0100
- -@@ -1902,14 +1902,16 @@
- -
- - /* Must be in infrastructure mode during scan, otherwise we don't get a full
- - * list of scan results. Scanning doesn't work well in Ad-Hoc mode :(
- -- */
- -- nm_device_802_11_wireless_set_mode (self, IW_MODE_INFRA);
- --
- -- /* We only unlock the frequency if the card is in adhoc mode, in case it is
- -- * a costly operation for the driver.
- -+ *
- -+ * We only set the mode and unlock the frequency if the card is in adhoc mode,
- -+ * in case doing so is a costly operation for the driver or the driver prefers
- -+ * IW_MODE_AUTO.
- - */
- - if (orig_mode == IW_MODE_ADHOC)
- -+ {
- -+ nm_device_802_11_wireless_set_mode (self, IW_MODE_INFRA);
- - nm_device_802_11_wireless_set_frequency (self, 0);
- -+ }
- -
- - wrq.u.data.pointer = NULL;
- - wrq.u.data.flags = 0;
- -@@ -2489,13 +2491,28 @@
- - const char * iface = nm_device_get_iface (NM_DEVICE (self));
- - gboolean success = FALSE;
- - int tries = 0;
- -+ const char * wpa_driver;
- -+ const char * kernel_driver;
- -
- - if (!(ctrl = wpa_ctrl_open (WPA_SUPPLICANT_GLOBAL_SOCKET, NM_RUN_DIR)))
- - goto exit;
- -
- -+ kernel_driver = nm_device_get_driver (NM_DEVICE (self));
- -+
- -+ /*
- -+ * We want to work with the generic "wext" wpa_supplicant driver, but some kernel drivers
- -+ * are just utter junk. For those losers, we use a specific wpa_supplicant driver.
- -+ */
- -+ if (!strcmp (kernel_driver, "ath_pci"))
- -+ wpa_driver = "madwifi";
- -+ else if (!strcmp (kernel_driver, "ndiswrapper"))
- -+ wpa_driver = "ndiswrapper";
- -+ else
- -+ wpa_driver = "wext";
- -+
- - /* wpa_cli -g/var/run/wpa_supplicant-global interface_add eth1 "" wext /var/run/wpa_supplicant */
- - if (!nm_utils_supplicant_request_with_check (ctrl, "OK", __func__, NULL,
- -- "INTERFACE_ADD %s\t\twext\t" WPA_SUPPLICANT_CONTROL_SOCKET "\t", iface))
- -+ "INTERFACE_ADD %s\t\t%s\t" WPA_SUPPLICANT_CONTROL_SOCKET "\t", iface, wpa_driver))
- - goto exit;
- - wpa_ctrl_close (ctrl);
- -
- -@@ -2531,7 +2548,8 @@
- - struct wpa_ctrl * ctrl;
- - gboolean user_created;
- - const char * hex_essid;
- -- const char * ap_scan = "AP_SCAN 1";
- -+ const char * ap_scan;
- -+ const char * kernel_driver;
- - guint32 caps;
- - gboolean supports_wpa;
- -
- -@@ -2552,15 +2570,24 @@
- - supports_wpa = (caps & NM_802_11_CAP_PROTO_WPA)
- - || (caps & NM_802_11_CAP_PROTO_WPA2);
- -
- -- /* Use "AP_SCAN 2" if:
- -- * - The wireless network is non-broadcast or user created
- -- * - The wireless driver does not support WPA
- -- */
- - user_created = nm_ap_get_user_created (ap);
- -- if (!nm_ap_get_broadcast (ap) || user_created || !supports_wpa)
- -+ kernel_driver = nm_device_get_driver (NM_DEVICE (self));
- -+
- -+ /*
- -+ * We want to use "AP_SCAN 1", which tells wpa_supplicant to perform scanning. This seems
- -+ * to work better with some drivers. But we want "AP_SCAN 2", telling wpa_supplicant that
- -+ * we will do our own scanning, if
- -+ *
- -+ * - The driver is orinoco_cs. It chokes on "AP_SCAN 1".
- -+ * - The AP is non-broadcast or Ad-Hoc. Unless the driver is madwifi.
- -+ */
- -+ if (!strcmp (kernel_driver, "orinoco_cs"))
- -+ ap_scan = "AP_SCAN 2";
- -+ else if ((!nm_ap_get_broadcast (ap) || user_created) && strcmp (kernel_driver, "ath_pci"))
- - ap_scan = "AP_SCAN 2";
- -+ else
- -+ ap_scan = "AP_SCAN 1";
- -
- -- /* Tell wpa_supplicant that we'll do the scanning */
- - if (!nm_utils_supplicant_request_with_check (ctrl, "OK", __func__, NULL, ap_scan))
- - goto out;
- -
reverted:
- --- network-manager-0.6.3/debian/patches/11-j-hostap-supplicant-driver.patch
+++ network-manager-0.6.3.orig/debian/patches/11-j-hostap-supplicant-driver.patch
@@ -1,11 +0,0 @@
- ---- src/nm-device-802-11-wireless.c~ 2006-07-12 22:10:59.000000000 +0100
- -+++ src/nm-device-802-11-wireless.c 2006-07-12 22:11:11.000000000 +0100
- -@@ -2507,6 +2507,8 @@
- - wpa_driver = "madwifi";
- - else if (!strcmp (kernel_driver, "ndiswrapper"))
- - wpa_driver = "ndiswrapper";
- -+ else if (!strcmp (kernel_driver, "hostap_pci") || !strcmp (kernel_driver, "hostap_cs") || !strcmp (kernel_driver, "hostap_plx"))
- -+ wpa_driver = "hostap";
- - else
- - wpa_driver = "wext";
- -
diff -u network-manager-0.6.3/debian/changelog network-manager-0.6.3/debian/changelog
- --- network-manager-0.6.3/debian/changelog
+++ network-manager-0.6.3/debian/changelog
@@ -1,3 +1,10 @@
+network-manager (0.6.3-2ubuntu6) edgy; urgency=low
+
+ * Removed the ndiswrapper specific sections from the patches.
+ + (Ubuntu #42504) (Ubuntu #46136)
+
+ -- David R.S. Robinson <email address hidden> Wed, 4 Oct 2006 06:55:02 -0700
+
 network-manager (0.6.3-2ubuntu5) edgy; urgency=low

   * Rebuild against dbus 0.90
only in patch2:
unchanged:
- --- network-manager-0.6.3.orig/debian/patches/10-rml-j-workarounds.patch
+++ network-manager-0.6.3/debian/patches/10-rml-j-workarounds.patch
@@ -0,0 +1,95 @@
+--- src/nm-device-802-11-wireless.c 2006-10-04 06:52:50.000000000 -0700
++++ src/nm-device-802-11-wireless.c.new 2006-10-04 06:52:26.000000000 -0700
+@@ -1902,14 +1902,16 @@
+
+ /* Must be in infrastructure mode during scan, otherwise we don't get a full
+ * list of scan results. Scanning doesn't work well in Ad-Hoc mode :(
+- */
+- nm_device_802_11_wireless_set_mode (self, IW_MODE_INFRA);
+-
+- /* We only unlock the frequency if the card is in adhoc mode, in case it is
+- * a costly operation for the driver.
++ *
++ * We only set the mode and unlock the frequency if the card is in adhoc mode,
++ * in case doing so is a costly operation for the driver or the driver prefers
++ * IW_MODE_AUTO.
+ */
+ if (orig_mode == IW_MODE_ADHOC)
++ {
++ nm_device_802_11_wireless_set_mode (self, IW_MODE_INFRA);
+ nm_device_802_11_wireless_set_frequency (self, 0);
++ }
+
+ wrq.u.data.pointer = NULL;
+ wrq.u.data.flags = 0;
+@@ -2489,13 +2491,28 @@
+ const char * iface = nm_device_get_iface (NM_DEVICE (self));
+ gboolean success = FALSE;
+ int tries = 0;
++ const char * wpa_driver;
++ const char * kernel_driver;
+
+ if (!(ctrl = wpa_ctrl_open (WPA_SUPPLICANT_GLOBAL_SOCKET, NM_RUN_DIR)))
+ goto exit;
+
++ kernel_driver = nm_device_get_driver (NM_DEVICE (self));
++
++ /*
++ * We want to work with the generic "wext" wpa_supplicant driver, but some kernel drivers
++ * are just utter junk. For those losers, we use a specific wpa_supplicant driver.
++ */
++ if (!strcmp (kernel_driver, "ath_pci"))
++ wpa_driver = "madwifi";
++ else if (!strcmp (kernel_driver, "hostap_pci") || !strcmp (kernel_driver, "hostap_cs") || !strcmp (kernel_driver, "hostap_plx"))
++ wpa_driver = "hostap";
++ else
++ wpa_driver = "wext";
++
+ /* wpa_cli -g/var/run/wpa_supplicant-global interface_add eth1 "" wext /var/run/wpa_supplicant */
+ if (!nm_utils_supplicant_request_with_check (ctrl, "OK", __func__, NULL,
+- "INTERFACE_ADD %s\t\twext\t" WPA_SUPPLICANT_CONTROL_SOCKET "\t", iface))
++ "INTERFACE_ADD %s\t\t%s\t" WPA_SUPPLICANT_CONTROL_SOCKET "\t", iface, wpa_driver))
+ goto exit;
+ wpa_ctrl_close (ctrl);
+
+@@ -2531,7 +2548,8 @@
+ struct wpa_ctrl * ctrl;
+ gboolean user_created;
+ const char * hex_essid;
+- const char * ap_scan = "AP_SCAN 1";
++ const char * ap_scan;
++ const char * kernel_driver;
+ guint32 caps;
+ gboolean supports_wpa;
+
+@@ -2552,15 +2570,24 @@
+ supports_wpa = (caps & NM_802_11_CAP_PROTO_WPA)
+ || (caps & NM_802_11_CAP_PROTO_WPA2);
+
+- /* Use "AP_SCAN 2" if:
+- * - The wireless network is non-broadcast or user created
+- * - The wireless driver does not support WPA
+- */
+ user_created = nm_ap_get_user_created (ap);
+- if (!nm_ap_get_broadcast (ap) || user_created || !supports_wpa)
++ kernel_driver = nm_device_get_driver (NM_DEVICE (self));
++
++ /*
++ * We want to use "AP_SCAN 1", which tells wpa_supplicant to perform scanning. This seems
++ * to work better with some drivers. But we want "AP_SCAN 2", telling wpa_supplicant that
++ * we will do our own scanning, if
++ *
++ * - The driver is orinoco_cs. It chokes on "AP_SCAN 1".
++ * - The AP is non-broadcast or Ad-Hoc. Unless the driver is madwifi.
++ */
++ if (!strcmp (kernel_driver, "orinoco_cs"))
++ ap_scan = "AP_SCAN 2";
++ else if ((!nm_ap_get_broadcast (ap) || user_created) && strcmp (kernel_driver, "ath_pci"))
+ ap_scan = "AP_SCAN 2";
++ else
++ ap_scan = "AP_SCAN 1";
+
+- /* Tell wpa_supplicant that we'll do the scanning */
+ if (!nm_utils_supplicant_request_with_check (ctrl, "OK", __func__, NULL, ap_scan))
+ goto out;
+

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)

iEYEARECAAYFAkUjwZwACgkQ2wcaZqTSGsSM7ACdEcfzGSkcwda/GHQU7TwBrw8V
9JQAniCQacEY/CT8eZVQP0PynGqKKChq
=xrdo
-----END PGP SIGNATURE-----

Scott Robinson (scott-ubuntu) wrote :

Here is the debdiff in clearer form.

Please provide a rationale for this change, citing the bugs it fixes.

Changed in network-manager:
status: Unconfirmed → Rejected
Scott Robinson (scott-ubuntu) wrote :

I did, if you look at the debdiff I updated the changelog with a description of the changes and what bugs it fixes:

network-manager (0.6.3-2ubuntu6) edgy; urgency=low

* Removed the ndiswrapper specific sections from the patches.
  + (Ubuntu #42504) (Ubuntu #46136)
 -- David R.S. Robinson <email address hidden> Wed, 4 Oct 2006 06:55:02 -0700

Those bugs have over a dozen duplicates between them.

dholbach recommended I make this upload. Please let me know if there is any other information I need to supply?

Changed in network-manager:
status: Rejected → Needs Info
Riccardo Setti (giskard) wrote :

hello,

reading the mentioned bugs, it seems that we should apply this patch.

Riccardo Setti (giskard) on 2006-10-08
Changed in network-manager:
assignee: nobody → giskard
importance: Undecided → High
status: Needs Info → Confirmed
Reinhard Tartler (siretart) wrote :

Okay, I reviewed the patch, and I think it is pretty straigtforward.
NM MUST NOT USE the ndiswrapper backend when using kernels > 2.6.14 anymore. This is documented in /usr/share/doc/wpasupplicant/README.modes.gz

So I consider this patch pretty important and should be uploaded for the release candidate!

The patch was pretty hard to read, because it renamed a dpatch. I made a new version which is easier to read and review.

Michael (michaeljt) wrote :

Potentially, you could add

else if (!strcmp (kernel_driver, "rtl8180"))
   wpa_driver = "ipw";

to the list. However, I did not get this working fully. When I do add it, my wlan is still detected as WEP, and I have to explicitly tell it to connect to network "network.name" with WPA 1 encryption to get it to connect.

Michael (michaeljt) wrote :

I should clarify the last comment. I am using KNetworkManager as an interface to network_manager. I made the change mentioned in my last comment in network_manager, however it is KNetworkManager which shows my network as detected as WEP, but allows me to connect to it using WPA when I specifically request it. I don't know whether KNetworkManager is purely a wrapper, or whether it does its own things as well.

Matt Zimmerman (mdz) wrote :

Riccardo Setti assigned this to himself, but not being a core developer, cannot commit the fix. Reassigning to Tollef.

Changed in network-manager:
assignee: giskard → tfheen
Tollef Fog Heen (tfheen) wrote :

Changes:
 network-manager (0.6.3-2ubuntu6) edgy; urgency=low
 .
   * ndiswrapper uses the stock wext driver now, so remove that bit of the
     10-rml-wpa-workarounds.patch. Adjust
     11-j-hostap-supplicant-driver.patch appropriately. Malone: #46136

Changed in network-manager:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers