From 9a898ee8796eb61650af9c7f4960e0c56317e1e4 Mon Sep 17 00:00:00 2001 From: Helmut Schaa Date: Sat, 19 Nov 2011 19:09:49 +0200 Subject: [PATCH] Avoid excessive probe response retries Some client implementations only wait a few ms after sending a probe request while scanning. Since probe responses are always sent at a low rate this can eat quite some airtime and it might be impossible to get the frame out before the client leaves the channel again. If the client leaves before all probe reponses where acked this can cause the probe reponse to be retried quite often consuming even more airtime. Hence, add a new noack flag to the driver's send_mlme callback that allows hostapd to request whether the driver should expect an ACK for this frame or not. Use the new noack-policy only for broadcast probe requests that contain a wildcard SSID. Signed-hostap: Helmut Schaa --- src/ap/beacon.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/ap/beacon.c b/src/ap/beacon.c index 626783123..c9bbfa93b 100644 --- a/src/ap/beacon.c +++ b/src/ap/beacon.c @@ -198,6 +198,7 @@ void handle_probe_req(struct hostapd_data *hapd, struct sta_info *sta = NULL; size_t buflen; size_t i; + int noack; ie = mgmt->u.probe_req.variable; if (len < IEEE80211_HDRLEN + sizeof(mgmt->u.probe_req)) @@ -407,7 +408,13 @@ void handle_probe_req(struct hostapd_data *hapd, pos = hostapd_eid_p2p_manage(hapd, pos); #endif /* CONFIG_P2P_MANAGER */ - if (hostapd_drv_send_mlme(hapd, resp, pos - (u8 *) resp, 0) < 0) + /* + * If this is a broadcast probe request, apply no ack policy to avoid + * excessive retries. + */ + noack = !!(elems.ssid_len == 0 && is_broadcast_ether_addr(mgmt->da)); + + if (hostapd_drv_send_mlme(hapd, resp, pos - (u8 *) resp, noack) < 0) perror("handle_probe_req: send"); os_free(resp);