From 4cc61c3866758eb665af3e9fc95f8199bee0e700 Mon Sep 17 00:00:00 2001 From: Daniel Kim Date: Mon, 30 Jan 2017 13:23:29 +0200 Subject: [PATCH] GAS: Set temporary session timeout bigger than gas_comeback_delay Previously, the temporary STA session timeout was set to 5 seconds. If gas_comeback_delay is configured to be longer than 5 seconds, GAS Comeback Response frame can't include queried information as all pending data has already been cleared due to session timeout. This commit resolves the issue by setting session timeout to be larger than gas_comeback_delay. Signed-off-by: Daniel Kim --- src/ap/gas_serv.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/ap/gas_serv.c b/src/ap/gas_serv.c index 3878ce6d8..95f0a667e 100644 --- a/src/ap/gas_serv.c +++ b/src/ap/gas_serv.c @@ -50,9 +50,12 @@ gas_dialog_create(struct hostapd_data *hapd, const u8 *addr, u8 dialog_token) sta->flags |= WLAN_STA_GAS; /* * The default inactivity is 300 seconds. We don't need - * it to be that long. + * it to be that long. Use five second timeout and increase this + * with the comeback_delay for testing cases. */ - ap_sta_session_timeout(hapd, sta, 5); + ap_sta_session_timeout(hapd, sta, + hapd->conf->gas_comeback_delay / 1024 + + 5); } else { ap_sta_replenish_timeout(hapd, sta, 5); }