[PATCH 2/3] hostapd: Avoid excessive probe response retries

Helmut Schaa helmut.schaa at googlemail.com
Thu Nov 10 10:21:20 EST 2011


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 if 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 <helmut.schaa at googlemail.com>
---
 src/ap/beacon.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/src/ap/beacon.c b/src/ap/beacon.c
index 6267831..7344516 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,11 @@ 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)
+	/* 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);
-- 
1.7.3.4



More information about the HostAP mailing list