diff mbox

Send "TERMINATING" event from hostapd

Message ID 20161212131351.13827-1-tomoharu.hatano@sonymobile.com
State Accepted
Headers show

Commit Message

Tomoharu Hatano Dec. 12, 2016, 1:13 p.m. UTC
From: Daisuke Niwa <daisuke.x.niwa@sonymobile.com>

Hostapd doesn't send "TERMINATING" event when stopping by
SIGTERM. Android handles this event to stop monitor thread.

This patch adds "TERMINATING" event same as wpa_supplicant.

Change-Id: Ie31339085bf656df1895c762d4b38ba1e3de726f
Signed-off-by: Tomoharu Hatano <tomoharu.hatano@sonymobile.com>
---
 src/ap/hostapd.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Jouni Malinen Dec. 12, 2016, 10:59 p.m. UTC | #1
On Mon, Dec 12, 2016 at 10:13:51PM +0900, Tomoharu Hatano wrote:
> Hostapd doesn't send "TERMINATING" event when stopping by
> SIGTERM. Android handles this event to stop monitor thread.
> 
> This patch adds "TERMINATING" event same as wpa_supplicant.

Thanks, applied.
Tomoharu Hatano Dec. 13, 2016, 12:09 a.m. UTC | #2
Hi Joini,

Thank you for your approval.

Best Regards,
Tomoharu Hatano

-----Original Message-----
From: Jouni Malinen [mailto:j@w1.fi] 
Sent: Tuesday, December 13, 2016 7:59 AM
To: Hatano, Tomoharu (Sony Mobile) <Tomoharu.Hatano@sonymobile.com>
Cc: hostap@lists.infradead.org; Sogo, Shinji (Sony Mobile) <Shinji.Sogo@sonymobile.com>; Nanbu, Tomonori (Sony Mobile) <Tomonori.Nanbu@sonymobile.com>; Niwa, Daisuke X (Sony Mobile) <Daisuke.X.Niwa@sonymobile.com>
Subject: Re: [PATCH] Send "TERMINATING" event from hostapd

On Mon, Dec 12, 2016 at 10:13:51PM +0900, Tomoharu Hatano wrote:
> Hostapd doesn't send "TERMINATING" event when stopping by SIGTERM. 
> Android handles this event to stop monitor thread.
> 
> This patch adds "TERMINATING" event same as wpa_supplicant.

Thanks, applied.
diff mbox

Patch

diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
index 42c1aaaeb..752ca067e 100644
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
@@ -355,8 +355,10 @@  static void hostapd_cleanup(struct hostapd_data *hapd)
 	wpa_printf(MSG_DEBUG, "%s(hapd=%p (%s))", __func__, hapd,
 		   hapd->conf->iface);
 	if (hapd->iface->interfaces &&
-	    hapd->iface->interfaces->ctrl_iface_deinit)
+	    hapd->iface->interfaces->ctrl_iface_deinit) {
+		wpa_msg(hapd->msg_ctx, MSG_INFO, WPA_EVENT_TERMINATING);
 		hapd->iface->interfaces->ctrl_iface_deinit(hapd);
+	}
 	hostapd_free_hapd_data(hapd);
 }