[Bug 63975] [NEW] network-manager and ndiswrapper are not friends

Launchpad Bug Tracker 63975 at bugs.launchpad.net
Thu Feb 17 08:44:22 UTC 2011


You have been subscribed to a public bug by Daniel Holbach (dholbach):

-----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 <scott at quadhome.com>  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-----

** Affects: network-manager (Ubuntu)
     Importance: High
     Assignee: Tollef Fog Heen (tfheen)
         Status: Fix Released

-- 
network-manager and ndiswrapper are not friends
https://bugs.launchpad.net/bugs/63975
You received this bug notification because you are a member of Ubuntu Sponsors Team, which is a direct subscriber.



More information about the Ubuntu-sponsors mailing list