Patchwork wpa_supplicant: Reduce wait time for control interfaces

login
register
mail settings
Submitter Ilan Peer
Date Aug. 7, 2013, 10:08 a.m.
Message ID <1375870125-27991-1-git-send-email-ilan.peer@intel.com>
Download mbox | patch
Permalink /patch/265469/
State Accepted
Commit e0591c3cfe3f8937a9f216ddcf49ed3a94238179
Headers show

Comments

Ilan Peer - Aug. 7, 2013, 10:08 a.m.
Reduce the wait time for the monitor control interfaces to get
messages on wipa_supplicant de-init etc., as this significantly delays
the shutdown of the wpa_supplicant.

Signed-hostap: Ilan Peer <ilan.peer@intel.com>
---
 wpa_supplicant/ctrl_iface_udp.c  |    4 ++--
 wpa_supplicant/ctrl_iface_unix.c |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
Jouni Malinen - Aug. 25, 2013, 6:49 a.m.
On Wed, Aug 07, 2013 at 01:08:37PM +0300, Ilan Peer wrote:
> Reduce the wait time for the monitor control interfaces to get
> messages on wipa_supplicant de-init etc., as this significantly delays
> the shutdown of the wpa_supplicant.

Thanks, applied.

Patch

diff --git a/wpa_supplicant/ctrl_iface_udp.c b/wpa_supplicant/ctrl_iface_udp.c
index f3b660d..e581aca 100644
--- a/wpa_supplicant/ctrl_iface_udp.c
+++ b/wpa_supplicant/ctrl_iface_udp.c
@@ -331,13 +331,13 @@  void wpa_supplicant_ctrl_iface_deinit(struct ctrl_iface_priv *priv)
 		eloop_unregister_read_sock(priv->sock);
 		if (priv->ctrl_dst) {
 			/*
-			 * Wait a second before closing the control socket if
+			 * Wait before closing the control socket if
 			 * there are any attached monitors in order to allow
 			 * them to receive any pending messages.
 			 */
 			wpa_printf(MSG_DEBUG, "CTRL_IFACE wait for attached "
 				   "monitors to receive messages");
-			os_sleep(1, 0);
+			os_sleep(0, 100000);
 		}
 		close(priv->sock);
 		priv->sock = -1;
diff --git a/wpa_supplicant/ctrl_iface_unix.c b/wpa_supplicant/ctrl_iface_unix.c
index fc0d649..11befea 100644
--- a/wpa_supplicant/ctrl_iface_unix.c
+++ b/wpa_supplicant/ctrl_iface_unix.c
@@ -495,13 +495,13 @@  void wpa_supplicant_ctrl_iface_deinit(struct ctrl_iface_priv *priv)
 		eloop_unregister_read_sock(priv->sock);
 		if (!dl_list_empty(&priv->ctrl_dst)) {
 			/*
-			 * Wait a second before closing the control socket if
+			 * Wait before closing the control socket if
 			 * there are any attached monitors in order to allow
 			 * them to receive any pending messages.
 			 */
 			wpa_printf(MSG_DEBUG, "CTRL_IFACE wait for attached "
 				   "monitors to receive messages");
-			os_sleep(1, 0);
+			os_sleep(0, 100000);
 		}
 		close(priv->sock);
 		priv->sock = -1;