From patchwork Fri Dec 9 05:10:10 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: jungwalk@gmail.com X-Patchwork-Id: 130281 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 C98EA1007D7 for ; Fri, 9 Dec 2011 16:10:35 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 706949D0C7; Fri, 9 Dec 2011 00:10:30 -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 EAp1eScPKYLx; Fri, 9 Dec 2011 00:10:30 -0500 (EST) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 5F72E9D0D0; Fri, 9 Dec 2011 00:10:26 -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 A8CCD9D0D0 for ; Fri, 9 Dec 2011 00:10:25 -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 TE2rMK6WzXPA for ; Fri, 9 Dec 2011 00:10:22 -0500 (EST) Received: from mail-gx0-f172.google.com (mail-gx0-f172.google.com [209.85.161.172]) (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 E4D339D0C7 for ; Fri, 9 Dec 2011 00:10:21 -0500 (EST) Received: by ggnk5 with SMTP id k5so4112016ggn.17 for ; Thu, 08 Dec 2011 21:10:21 -0800 (PST) Received: by 10.101.213.32 with SMTP id p32mr1448981anq.52.1323407421447; Thu, 08 Dec 2011 21:10:21 -0800 (PST) Received: from localhost.localdomain (220-132-160-32.HINET-IP.hinet.net. [220.132.160.32]) by mx.google.com with ESMTPS id l11sm20835551anm.22.2011.12.08.21.10.19 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 08 Dec 2011 21:10:21 -0800 (PST) From: jungwalk@gmail.com To: hostap@lists.shmoo.com Subject: [PATCH] Reset the ssid in wps before being replaced with the one in credential. Date: Fri, 9 Dec 2011 13:10:10 +0800 Message-Id: <1323407410-25072-1-git-send-email-jungwalk@gmail.com> X-Mailer: git-send-email 1.7.2.5 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 From: Spencer Chang It is better to reset the ssid in WPS first before it is replaced with the one in credential in case the length of ssid in credential is longer than wps->ssid. Signed-off-by: Spencer Chang --- src/ap/wps_hostapd.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/src/ap/wps_hostapd.c b/src/ap/wps_hostapd.c index 817012e..42b22a2 100644 --- a/src/ap/wps_hostapd.c +++ b/src/ap/wps_hostapd.c @@ -318,6 +318,7 @@ static int hapd_wps_cred_cb(struct hostapd_data *hapd, void *ctx) if (hapd->conf->wps_cred_processing == 1) return 0; + os_memset(hapd->wps->ssid, 0, HOSTAPD_MAX_SSID_LEN); os_memcpy(hapd->wps->ssid, cred->ssid, cred->ssid_len); hapd->wps->ssid_len = cred->ssid_len; hapd->wps->encr_types = cred->encr_type;