rpms/wpa_supplicant/F-11 wpa_supplicant-0.6.8-disconnect-fixes.patch, NONE, 1.1 wpa_supplicant.spec, 1.56, 1.57

Daniel Williams dcbw at fedoraproject.org
Tue May 12 18:15:31 UTC 2009


Author: dcbw

Update of /cvs/extras/rpms/wpa_supplicant/F-11
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv16653

Modified Files:
	wpa_supplicant.spec 
Added Files:
	wpa_supplicant-0.6.8-disconnect-fixes.patch 
Log Message:
* Tue May 12 2009 Dan Williams <dcbw at redhat.com> - 1:0.6.8-2
- Avoid creating bogus Ad-Hoc networks when forcing the driver to disconnect (rh #497771)



wpa_supplicant-0.6.8-disconnect-fixes.patch:

--- NEW FILE wpa_supplicant-0.6.8-disconnect-fixes.patch ---
diff --git a/src/drivers/driver_wext.c b/src/drivers/driver_wext.c
index e6242da..698e4f3 100644
--- a/src/drivers/driver_wext.c
+++ b/src/drivers/driver_wext.c
@@ -1923,21 +1923,35 @@ static int wpa_driver_wext_mlme(struct wpa_driver_wext_data *drv,
 
 static void wpa_driver_wext_disconnect(struct wpa_driver_wext_data *drv)
 {
+	struct iwreq iwr;
 	const u8 null_bssid[ETH_ALEN] = { 0, 0, 0, 0, 0, 0 };
 	u8 ssid[32];
 	int i;
 
-	/*
-	 * Clear the BSSID selection and set a random SSID to make sure the
-	 * driver will not be trying to associate with something even if it
-	 * does not understand SIOCSIWMLME commands (or tries to associate
-	 * automatically after deauth/disassoc).
+	/* Only force-disconnect when the card is in infrastructure mode,
+	 * otherwise the driver might interpret the cleared BSSID and random
+	 * SSID as an attempt to create a new ad-hoc network.
 	 */
-	wpa_driver_wext_set_bssid(drv, null_bssid);
+	os_memset(&iwr, 0, sizeof(iwr));
+	os_strlcpy(iwr.ifr_name, drv->ifname, IFNAMSIZ);
+	if (ioctl(drv->ioctl_sock, SIOCGIWMODE, &iwr) < 0) {
+		perror("ioctl[SIOCGIWMODE]");
+		iwr.u.mode = IW_MODE_INFRA;
+	}
 
-	for (i = 0; i < 32; i++)
-		ssid[i] = rand() & 0xFF;
-	wpa_driver_wext_set_ssid(drv, ssid, 32);
+	if (iwr.u.mode == IW_MODE_INFRA) {
+		/*
+		 * Clear the BSSID selection and set a random SSID to make sure
+		 * the driver will not be trying to associate with something
+		 * even if it does not understand SIOCSIWMLME commands (or tries
+		 * to associate automatically after deauth/disassoc).
+		 */
+		wpa_driver_wext_set_bssid(drv, null_bssid);
+
+		for (i = 0; i < 32; i++)
+			ssid[i] = rand() & 0xFF;
+		wpa_driver_wext_set_ssid(drv, ssid, 32);
+	}
 }
 
 
@@ -1947,8 +1961,8 @@ static int wpa_driver_wext_deauthenticate(void *priv, const u8 *addr,
 	struct wpa_driver_wext_data *drv = priv;
 	int ret;
 	wpa_printf(MSG_DEBUG, "%s", __FUNCTION__);
-	wpa_driver_wext_disconnect(drv);
 	ret = wpa_driver_wext_mlme(drv, addr, IW_MLME_DEAUTH, reason_code);
+	wpa_driver_wext_disconnect(drv);
 	return ret;
 }
 


Index: wpa_supplicant.spec
===================================================================
RCS file: /cvs/extras/rpms/wpa_supplicant/F-11/wpa_supplicant.spec,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -p -r1.56 -r1.57
--- wpa_supplicant.spec	9 Mar 2009 21:08:47 -0000	1.56
+++ wpa_supplicant.spec	12 May 2009 18:15:01 -0000	1.57
@@ -2,7 +2,7 @@ Summary: WPA/WPA2/IEEE 802.1X Supplicant
 Name: wpa_supplicant
 Epoch: 1
 Version: 0.6.8
-Release: 1%{?dist}
+Release: 2%{?dist}
 License: BSD
 Group: System Environment/Base
 Source0: http://hostap.epitest.fi/releases/%{name}-%{version}.tar.gz
@@ -17,6 +17,7 @@ Patch1: wpa_supplicant-0.5.7-qmake-locat
 Patch2: wpa_supplicant-0.5.7-flush-debug-output.patch
 Patch4: wpa_supplicant-0.5.10-dbus-service-file.patch
 Patch5: wpa_supplicant-0.6.7-quiet-scan-results-message.patch
+Patch6: wpa_supplicant-0.6.8-disconnect-fixes.patch
 
 URL: http://w1.fi/wpa_supplicant/
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -49,6 +50,7 @@ Graphical User Interface for wpa_supplic
 %patch2 -p1 -b .flush-debug-output
 %patch4 -p1 -b .dbus-service-file
 %patch5 -p1 -b .quiet-scan-results-msg
+%patch6 -p1 -b .really-disassoc
 
 %build
 pushd wpa_supplicant
@@ -139,6 +141,9 @@ fi
 %{_bindir}/wpa_gui
 
 %changelog
+* Tue May 12 2009 Dan Williams <dcbw at redhat.com> - 1:0.6.8-2
+- Avoid creating bogus Ad-Hoc networks when forcing the driver to disconnect (rh #497771)
+
 * Mon Mar  9 2009 Dan Williams <dcbw at redhat.com> - 1:0.6.8-1
 - Update to latest upstream release
 




More information about the fedora-extras-commits mailing list