From 24e79280a9d8a8a52ec4f6bb74efefcaa9bb6ecb Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 19 Mar 2015 15:21:44 +0200 Subject: [PATCH] wiphy: DBus reply was sent too early when connecting PSK network We can give reply to connect DBus call in associating event only when we are connecting to Open network. For PSK AP, the reply can only be sent after we have finished 4-way handshaking. --- src/wiphy.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/wiphy.c b/src/wiphy.c index 153bf848..9c28fd74 100644 --- a/src/wiphy.c +++ b/src/wiphy.c @@ -767,9 +767,14 @@ static void mlme_associate_event(struct l_genl_msg *msg, struct netdev *netdev) } l_info("Association completed"); - reply = l_dbus_message_new_method_return(netdev->connect_pending); - l_dbus_message_set_arguments(reply, ""); - dbus_pending_reply(&netdev->connect_pending, reply); + + if (netdev->connected_bss && + netdev->connected_bss->network->ssid_security == + SCAN_SSID_SECURITY_NONE) { + reply = l_dbus_message_new_method_return(netdev->connect_pending); + l_dbus_message_set_arguments(reply, ""); + dbus_pending_reply(&netdev->connect_pending, reply); + } } static void genl_associate_cb(struct l_genl_msg *msg, void *user_data)