From patchwork Thu Nov 10 15:21:20 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helmut Schaa X-Patchwork-Id: 124904 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from maxx.maxx.shmoo.com (maxx.shmoo.com [205.134.188.171]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "maxx.shmoo.com", Issuer "CA Cert Signing Authority" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 48C7F1007D1 for ; Fri, 11 Nov 2011 02:22:02 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id A5FC79D246; Thu, 10 Nov 2011 10:21:58 -0500 (EST) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lplPvDswZHB2; Thu, 10 Nov 2011 10:21:58 -0500 (EST) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 1AAF817C009; Thu, 10 Nov 2011 10:21:39 -0500 (EST) X-Original-To: mailman-post+hostap@maxx.shmoo.com Delivered-To: mailman-post+hostap@maxx.shmoo.com Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 333DC9D246 for ; Thu, 10 Nov 2011 10:21:38 -0500 (EST) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id HYlL3UBXhGVN for ; Thu, 10 Nov 2011 10:21:34 -0500 (EST) Received: from mail-fx0-f44.google.com (mail-fx0-f44.google.com [209.85.161.44]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority" (not verified)) by maxx.maxx.shmoo.com (Postfix) with ESMTPS id D298317C009 for ; Thu, 10 Nov 2011 10:21:25 -0500 (EST) Received: by faas12 with SMTP id s12so4787076faa.17 for ; Thu, 10 Nov 2011 07:21:24 -0800 (PST) Received: by 10.223.5.201 with SMTP id 9mr12983550faw.5.1320938484860; Thu, 10 Nov 2011 07:21:24 -0800 (PST) Received: from localhost.localdomain (port-92-198-130-130.static.qsc.de. [92.198.130.130]) by mx.google.com with ESMTPS id y2sm11443907fag.12.2011.11.10.07.21.23 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 10 Nov 2011 07:21:24 -0800 (PST) From: Helmut Schaa To: hostap@lists.shmoo.com Subject: [PATCH 2/3] hostapd: Avoid excessive probe response retries Date: Thu, 10 Nov 2011 16:21:20 +0100 Message-Id: <1320938481-23936-2-git-send-email-helmut.schaa@googlemail.com> X-Mailer: git-send-email 1.7.3.4 In-Reply-To: <1320938481-23936-1-git-send-email-helmut.schaa@googlemail.com> References: <1320938481-23936-1-git-send-email-helmut.schaa@googlemail.com> X-BeenThere: hostap@lists.shmoo.com X-Mailman-Version: 2.1.9 Precedence: list List-Id: HostAP Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: hostap-bounces@lists.shmoo.com Errors-To: hostap-bounces@lists.shmoo.com 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 --- 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);