From patchwork Thu May 24 08:37:27 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neeraj Garg X-Patchwork-Id: 161076 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 303C2B6FC4 for ; Thu, 24 May 2012 18:37:59 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id D91009D23A; Thu, 24 May 2012 04:37:55 -0400 (EDT) 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 Cdr8jCf3cc54; Thu, 24 May 2012 04:37:55 -0400 (EDT) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id E0D389D343; Thu, 24 May 2012 04:37:51 -0400 (EDT) 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 B5DE29D0D3 for ; Thu, 24 May 2012 04:37:49 -0400 (EDT) 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 AwheisfuAGqO for ; Thu, 24 May 2012 04:37:44 -0400 (EDT) Received: from mms2.broadcom.com (mms2.broadcom.com [216.31.210.18]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 87BE09D23A for ; Thu, 24 May 2012 04:37:44 -0400 (EDT) Received: from [10.16.192.224] by mms2.broadcom.com with ESMTP (Broadcom SMTP Relay (Email Firewall v6.5)); Thu, 24 May 2012 01:38:11 -0700 X-Server-Uuid: 72204117-5C29-4314-8910-60DB108979CB Received: from SJEXCHCAS06.corp.ad.broadcom.com (10.16.203.15) by SJEXCHHUB01.corp.ad.broadcom.com (10.16.192.224) with Microsoft SMTP Server (TLS) id 8.2.247.2; Thu, 24 May 2012 01:37:28 -0700 Received: from SJEXCHMB12.corp.ad.broadcom.com ( [fe80::bc15:c1e1:c29a:36f7]) by SJEXCHCAS06.corp.ad.broadcom.com ( [::1]) with mapi id 14.01.0355.002; Thu, 24 May 2012 01:37:27 -0700 From: "Neeraj Kumar Garg" To: "hostap@lists.shmoo.com" Subject: [PATCH] P2P When UUID gets changed and more pbc session entries are created, remove logic should check for loop entry address Thread-Topic: [PATCH] P2P When UUID gets changed and more pbc session entries are created, remove logic should check for loop entry address Thread-Index: Ac05iHlq5yBxyUGASq6DkyTi9qYXBg== Date: Thu, 24 May 2012 08:37:27 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.132.71.78] MIME-Version: 1.0 X-WSS-ID: 63A32CF955G597055-01-01 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: , Sender: hostap-bounces@lists.shmoo.com Errors-To: hostap-bounces@lists.shmoo.com When UUID gets changed between a received probe request (for wps) and the M1 message, we might endup creating 2 entries in pbc sessions list (with same device address and different UUID). But when we try to remove the entries, we need to compare that pbc sessions list entry->address. This will ensure that both entries gets removed. Please let me know if the below patch is OK or I am missing something in my understanding. From 1785eabf9c28bcd3012cc18bc510711f7f8febb9 Mon Sep 17 00:00:00 2001 From: Neeraj Garg Date: Thu, 24 May 2012 14:01:40 +0530 Subject: [PATCH] Patch:P2P When UUID gets changed and more pbc session entries are created, remove logic should check for loop entry address Signed-off-by: Neeraj Garg --- src/wps/wps_registrar.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) mode change 100644 => 100755 src/wps/wps_registrar.c diff --git a/src/wps/wps_registrar.c b/src/wps/wps_registrar.c old mode 100644 new mode 100755 index e6ec04c..678375b --- a/src/wps/wps_registrar.c +++ b/src/wps/wps_registrar.c @@ -313,8 +313,8 @@ static void wps_registrar_remove_pbc_session(struct wps_registrar *reg, pbc = reg->pbc_sessions; while (pbc) { if (os_memcmp(pbc->uuid_e, uuid_e, WPS_UUID_LEN) == 0 || - (p2p_dev_addr && !is_zero_ether_addr(reg->p2p_dev_addr) && - os_memcmp(reg->p2p_dev_addr, p2p_dev_addr, ETH_ALEN) == + (p2p_dev_addr && !is_zero_ether_addr(pbc->addr) && + os_memcmp(pbc->addr, p2p_dev_addr, ETH_ALEN) == 0)) { if (prev) prev->next = pbc->next;