From patchwork Thu May 2 11:52:27 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krishna Chaitanya X-Patchwork-Id: 240947 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 C635D2C00CC for ; Thu, 2 May 2013 21:53:15 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id ABA739C1E4; Thu, 2 May 2013 07:53:11 -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 WQNJrwEF++yj; Thu, 2 May 2013 07:53:11 -0400 (EDT) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 479C19C18D; Thu, 2 May 2013 07:53:06 -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 782AA9C18B for ; Thu, 2 May 2013 07:53:04 -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 CPlacd42OXjY for ; Thu, 2 May 2013 07:52:58 -0400 (EDT) Received: from mail-pb0-f49.google.com (mail-pb0-f49.google.com [209.85.160.49]) (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 7A1C19C18D for ; Thu, 2 May 2013 07:52:58 -0400 (EDT) Received: by mail-pb0-f49.google.com with SMTP id rp8so311128pbb.36 for ; Thu, 02 May 2013 04:52:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:reply-to:user-agent:mime-version:to :cc:subject:references:in-reply-to:x-forwarded-message-id :content-type:content-transfer-encoding; bh=enVqfGZvZePtea59nA9ajAZ8NX3HnZb7wv5uEA6M9dA=; b=V7RvqBnK9paKX8MOzY08hqOaH84tawVwhlyZ/6gQfIbOjDahAFViQoOvMO5jm2ATb4 Fl94txSmmC5MCDMAPJ3GbK3fYWK8D9o06eBixnPKSKdcauL9XfdQwSMMGlRcbU4Dyvkh Xmqh8QCxsEo3QKzh/8rEywbaAFTPyY+zRPS1HBkFZIjvlNonwvwuL8iNCNV1Sxl0F2Yy UKwFYMugaXt43q7Kt/7DCdTMooqG/Sa3f9QbId+NNYIfmKmBNF5KOQoof6jmkx9EiqJo 1cok4aS1hQw9gvTNfdUrBOriTLGACDanV6hNWFExy5+wJsqfIfUQ4PvWYrTCDMrRoH/n moCA== X-Received: by 10.66.172.233 with SMTP id bf9mr9237628pac.139.1367495577205; Thu, 02 May 2013 04:52:57 -0700 (PDT) Received: from [192.168.10.129] ([122.183.20.86]) by mx.google.com with ESMTPSA id ov2sm7062023pbc.34.2013.05.02.04.52.52 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 02 May 2013 04:52:55 -0700 (PDT) Message-ID: <5182537B.1030204@gmail.com> Date: Thu, 02 May 2013 17:22:27 +0530 From: Chaitanya TK User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130106 Thunderbird/17.0.2 MIME-Version: 1.0 To: hostap@lists.shmoo.com Subject: [PATCH] Fix the injection of protected broadcast frames References: <201305020847.r428lMIo003516@chaitanya-desktop> In-Reply-To: <201305020847.r428lMIo003516@chaitanya-desktop> X-Forwarded-Message-Id: <201305020847.r428lMIo003516@chaitanya-desktop> Cc: j@w1.fi, chaitanyatk@posedge.com, Mark Bilstad , Janardhan Reddy R X-BeenThere: hostap@lists.shmoo.com X-Mailman-Version: 2.1.11 Precedence: list Reply-To: chaitanya.mgit@gmail.com 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 Injecting protected broadcast frames fails because of the unnecessary null check for sta. In case of broadcast frames sta can be null, so remove the check. Reported-by: Janardhan R Signed-hostap: Chaitanya T K --- wlantest/inject.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wlantest/inject.c b/wlantest/inject.c index ab8d113..a868f21 100644 --- a/wlantest/inject.c +++ b/wlantest/inject.c @@ -286,8 +286,8 @@ int wlantest_inject(struct wlantest *wt, struct wlantest_bss *bss, } if (prot != WLANTEST_INJECT_UNPROTECTED && - (bss == NULL || sta == NULL)) { - wpa_printf(MSG_INFO, "No BSS/STA information to inject " + bss == NULL) { /* STA can be NULL in case of Broadcast frames*/ + wpa_printf(MSG_INFO, "No BSS information to inject " "protected frames"); return -1; }