[PATCH] WEXT: Suppress additional DISASSOCIATE events

Dmitry Shmidt dimitrysh
Wed Feb 24 13:19:37 PST 2010


Signed-off-by: Dmitry Shmidt <dimitrysh at google.com>
---
 src/drivers/driver_wext.c |   11 ++++++++---
 src/drivers/driver_wext.h |    1 +
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/drivers/driver_wext.c b/src/drivers/driver_wext.c
index 2614f23..3e00fa5 100644
--- a/src/drivers/driver_wext.c
+++ b/src/drivers/driver_wext.c
@@ -470,11 +470,14 @@ static void
wpa_driver_wext_event_wireless(struct wpa_driver_wext_data *drv,
 				drv->assoc_req_ies =3D NULL;
 				os_free(drv->assoc_resp_ies);
 				drv->assoc_resp_ies =3D NULL;
-				wpa_supplicant_event(drv->ctx, EVENT_DISASSOC,
-						     NULL);
-		=09
+				if (!drv->skip_disconnect) {
+					drv->skip_disconnect =3D 1;
+					wpa_supplicant_event(drv->ctx, EVENT_DISASSOC,
+							     NULL);
+				}
 			} else {
 				wpa_driver_wext_event_assoc_ies(drv);
+				drv->skip_disconnect =3D 0;
 				wpa_supplicant_event(drv->ctx, EVENT_ASSOC,
 						     NULL);
 			}
@@ -733,6 +736,8 @@ void * wpa_driver_wext_init(void *ctx, const char *ifna=
me)

 	drv->mlme_sock =3D -1;

+	drv->skip_disconnect =3D 0;
+
 	if (wpa_driver_wext_finish_drv_init(drv) < 0)
 		goto err3;

diff --git a/src/drivers/driver_wext.h b/src/drivers/driver_wext.h
index 602c7e1..559e890 100644
--- a/src/drivers/driver_wext.h
+++ b/src/drivers/driver_wext.h
@@ -43,6 +43,7 @@ struct wpa_driver_wext_data {
 	char mlmedev[IFNAMSIZ + 1];

 	int scan_complete_events;
+	int skip_disconnect;

 	int cfg80211; /* whether driver is using cfg80211 */
 };
--=20
1.6.2.2


On Mon, Feb 22, 2010 at 3:41 PM, Dmitry Shmidt <dimitrysh at google.com> wrote=
:
> Hello,
>
> Working with several WEXT-supported driver I see that they are sending
> SIOCGIWAP event
> (DISASSOCIATE) for both DISASSOCIATE and DEAUTHENTICATE internal driver e=
vents
> by using
> =A0wireless_send_event(SIOCGIWAP);
>
> In case of AP with no security it will be just one message, but
> otherwise it will send the message twice.
> driver_wext.c event handling will call
> =A0 wpa_supplicant_event(ctx, EVENT_DISASSOC, NULL);
> twice for each of driver's events with small delay.
>
> It is not a big deal for wpa_supplicant itself but it may confuse
> network manager.
>
> Will it be "safe" to suppress the second message on driver_wext.c layer?
> Am I missing something?
>
> Thanks,
>
> Dmitry
>

--000e0cd13bc80bf74a04805f40fe
Content-Type: application/octet-stream; 
	name="0001-WEXT-Suppress-additional-DISASSOCIATE-events.patch"
Content-Disposition: attachment; 
	filename="0001-WEXT-Suppress-additional-DISASSOCIATE-events.patch"
Content-Transfer-Encoding: base64
X-Attachment-Id: f_g62mrerm0

RnJvbSBhYjA2NjJiYmQ0YTUwN2Y2Yzk3ZjgwYzZlNzQ4MmYyZWNlMjY2ZWY5IE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBEbWl0cnkgU2htaWR0IDxkaW1pdHJ5c2hAZ29vZ2xlLmNvbT4K
RGF0ZTogV2VkLCAyNCBGZWIgMjAxMCAxMzoxOTozNyAtMDgwMApTdWJqZWN0OiBbUEFUQ0hdIFdF
WFQ6IFN1cHByZXNzIGFkZGl0aW9uYWwgRElTQVNTT0NJQVRFIGV2ZW50cwoKU2lnbmVkLW9mZi1i
eTogRG1pdHJ5IFNobWlkdCA8ZGltaXRyeXNoQGdvb2dsZS5jb20+Ci0tLQogc3JjL2RyaXZlcnMv
ZHJpdmVyX3dleHQuYyB8ICAgMTEgKysrKysrKystLS0KIHNyYy9kcml2ZXJzL2RyaXZlcl93ZXh0
LmggfCAgICAxICsKIDIgZmlsZXMgY2hhbmdlZCwgOSBpbnNlcnRpb25zKCspLCAzIGRlbGV0aW9u
cygtKQoKZGlmZiAtLWdpdCBhL3NyYy9kcml2ZXJzL2RyaXZlcl93ZXh0LmMgYi9zcmMvZHJ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