aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/gas_query.c
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2013-10-21 11:36:27 (GMT)
committerJouni Malinen <j@w1.fi>2013-10-21 11:37:37 (GMT)
commit313424d46e59308bf3c16bd9734f1d92dcbf47aa (patch)
treed6d846bf8336f324ae9713d1d6d47f94a65532fb /wpa_supplicant/gas_query.c
parentcbc548489205b719897202cffdb3d692ea3ca60f (diff)
downloadhostap-313424d46e59308bf3c16bd9734f1d92dcbf47aa.zip
hostap-313424d46e59308bf3c16bd9734f1d92dcbf47aa.tar.gz
hostap-313424d46e59308bf3c16bd9734f1d92dcbf47aa.tar.bz2
GAS: Add support for multiple pending queries for the same destination
Need to use the pointer to the current ongoing query instead of matching from the pending list based on the destination address so that we get the correct query instance when processing the TX status report. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'wpa_supplicant/gas_query.c')
-rw-r--r--wpa_supplicant/gas_query.c29
1 files changed, 18 insertions, 11 deletions
diff --git a/wpa_supplicant/gas_query.c b/wpa_supplicant/gas_query.c
index c5554bd..f9885e3 100644
--- a/wpa_supplicant/gas_query.c
+++ b/wpa_supplicant/gas_query.c
@@ -153,21 +153,25 @@ static void gas_query_tx_status(struct wpa_supplicant *wpa_s,
const u8 *data, size_t data_len,
enum offchannel_send_action_result result)
{
- struct gas_query_pending *q, *query = NULL;
+ struct gas_query_pending *query;
struct gas_query *gas = wpa_s->gas;
- dl_list_for_each(q, &gas->pending, struct gas_query_pending, list) {
- if (os_memcmp(q->addr, dst, ETH_ALEN) == 0) {
- query = q;
- break;
- }
+ if (gas->current == NULL) {
+ wpa_printf(MSG_DEBUG, "GAS: Unexpected TX status: freq=%u dst="
+ MACSTR " result=%d - no query in progress",
+ freq, MAC2STR(dst), result);
+ return;
}
+ query = gas->current;
+
wpa_printf(MSG_DEBUG, "GAS: TX status: freq=%u dst=" MACSTR
- " result=%d query=%p",
- freq, MAC2STR(dst), result, query);
- if (!query)
+ " result=%d query=%p dialog_token=%u",
+ freq, MAC2STR(dst), result, query, query->dialog_token);
+ if (os_memcmp(dst, query->addr, ETH_ALEN) != 0) {
+ wpa_printf(MSG_DEBUG, "GAS: TX status for unexpected destination");
return;
+ }
if (result == OFFCHANNEL_SEND_ACTION_SUCCESS) {
eloop_cancel_timeout(gas_query_timeout, gas, query);
@@ -469,8 +473,9 @@ static void gas_query_timeout(void *eloop_data, void *user_ctx)
struct gas_query *gas = eloop_data;
struct gas_query_pending *query = user_ctx;
- wpa_printf(MSG_DEBUG, "GAS: No response received for query to " MACSTR,
- MAC2STR(query->addr));
+ wpa_printf(MSG_DEBUG, "GAS: No response received for query to " MACSTR
+ " dialog token %u",
+ MAC2STR(query->addr), query->dialog_token);
gas_query_done(gas, query, GAS_QUERY_TIMEOUT);
}
@@ -505,6 +510,8 @@ static void gas_service_timeout(void *eloop_data, void *user_ctx)
}
gas->current = query;
+ wpa_printf(MSG_DEBUG, "GAS: Starting query timeout for dialog token %u",
+ query->dialog_token);
eloop_register_timeout(GAS_QUERY_TIMEOUT_PERIOD, 0,
gas_query_timeout, gas, query);
}