From patchwork Sat Nov 15 01:35:27 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masashi Honma X-Patchwork-Id: 411104 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]) by ozlabs.org (Postfix) with ESMTP id 7124F14009B for ; Sat, 15 Nov 2014 12:38:01 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id D465517C3B7; Fri, 14 Nov 2014 20:37:56 -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 hjnUnsl7pd1q; Fri, 14 Nov 2014 20:37:56 -0500 (EST) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id D131F17C453; Fri, 14 Nov 2014 20:36:46 -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 2799B17C452 for ; Fri, 14 Nov 2014 20:36:46 -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 SBMndENGEace for ; Fri, 14 Nov 2014 20:36:39 -0500 (EST) Received: from mail-pa0-f53.google.com (mail-pa0-f53.google.com [209.85.220.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (not verified)) by maxx.maxx.shmoo.com (Postfix) with ESMTPS id C1D2317C302 for ; Fri, 14 Nov 2014 20:36:31 -0500 (EST) Received: by mail-pa0-f53.google.com with SMTP id kx10so18367783pab.26 for ; Fri, 14 Nov 2014 17:36:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=xQeceGjjlbWdqQGHddVAQuu/JdjOLdytcFwAmIcESSc=; b=U0WhFGbFKT2BZlBz6JQrYjIMILwWz+iNiim3Sb4I3LHkZzz3pwT+Fs9E8rRMMVwj2T mxFnxTAl/2+qi5N3X3ZUGlBtMWpY8Thumxwy4vCE2tBAPwQZMc5+A0oPGwjQqyl/B1/7 ARmLoWR9r7gmztU6giwdPTf+AqTrt8AC4xlkQMr40yuIEeN9b8GGNAEdJw8tGbm+KZ8o rMaXxqs7lAHLb1zXcNlwX2dNMUf2t4VVjtkgJ+uirG2YUYx/wnxmfKEPDVwr3L8zpTOA eo2Kr3nMd4IBegP11bh5LOhMP1m3lZ2d3hsjp5H2HSrhSoi5axeg9P3pj3api/xGa9Z6 cUKw== X-Received: by 10.70.126.194 with SMTP id na2mr14072793pdb.39.1416015391022; Fri, 14 Nov 2014 17:36:31 -0800 (PST) Received: from localhost.localdomain (pa8f752.kngwnt01.ap.so-net.ne.jp. [182.168.247.82]) by mx.google.com with ESMTPSA id th7sm6312634pac.47.2014.11.14.17.36.29 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 14 Nov 2014 17:36:30 -0800 (PST) From: Masashi Honma To: hostap@lists.shmoo.com Subject: [PATCH v2 05/10] mesh: Reduce none 11N Self-protected Action frame allocation size Date: Sat, 15 Nov 2014 10:35:27 +0900 Message-Id: <1416015332-6507-5-git-send-email-masashi.honma@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1416015332-6507-1-git-send-email-masashi.honma@gmail.com> References: <1416015332-6507-1-git-send-email-masashi.honma@gmail.com> Cc: Natsuki Itaya X-BeenThere: hostap@lists.shmoo.com X-Mailman-Version: 2.1.11 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 Signed-off-by: Natsuki Itaya Signed-off-by: Masashi Honma --- wpa_supplicant/mesh_mpm.c | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/wpa_supplicant/mesh_mpm.c b/wpa_supplicant/mesh_mpm.c index 4600672..99dbf52 100644 --- a/wpa_supplicant/mesh_mpm.c +++ b/wpa_supplicant/mesh_mpm.c @@ -220,21 +220,28 @@ static void mesh_mpm_send_plink_action(struct wpa_supplicant *wpa_s, u8 ie_len, add_plid = 0; int ret; int ampe = conf->security & MESH_CONF_SEC_AMPE; + size_t buf_len; if (!sta) return; - buf = wpabuf_alloc(2 + /* capability info */ - 2 + /* AID */ - 2 + 8 + /* supported rates */ - 2 + (32 - 8) + - 2 + 32 + /* mesh ID */ - 2 + 7 + /* mesh config */ - 2 + 26 + /* HT capabilities */ - 2 + 22 + /* HT operation */ - 2 + 23 + /* peering management */ - 2 + 96 + /* AMPE */ - 2 + 16); /* MIC */ + buf_len = 2 + /* capability info */ + 2 + /* AID */ + 2 + 8 + /* supported rates */ + 2 + (32 - 8) + + 2 + 32 + /* mesh ID */ + 2 + 7 + /* mesh config */ + 2 + 23 + /* peering management */ + 2 + 96 + /* AMPE */ + 2 + 16; /* MIC */ +#ifdef CONFIG_IEEE80211N + if (type != PLINK_CLOSE && + wpa_s->current_ssid->mesh_ht_mode > CHAN_NO_HT) { + buf_len += 2 + 26 + /* HT capabilities */ + 2 + 22; /* HT operation */ + } +#endif /* CONFIG_IEEE80211N */ + buf = wpabuf_alloc(buf_len); if (!buf) return;