Patchwork Fix the injection of protected broadcast frames

login
register
mail settings
Submitter Chaitanya TK
Date May 2, 2013, 11:52 a.m.
Message ID <5182537B.1030204@gmail.com>
Download mbox | patch
Permalink /patch/240947/
State Accepted
Commit 409cd147b7a0685cbcae180c4d81526dd10b9159
Headers show

Comments

Chaitanya TK - May 2, 2013, 11:52 a.m.
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 <janardhanr@posedge.com>
Signed-hostap: Chaitanya T K <chaitanyatk@posedge.com>
---
 wlantest/inject.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Jouni Malinen - May 4, 2013, 8:37 a.m.
On Thu, May 02, 2013 at 05:22:27PM +0530, Chaitanya TK wrote:
> 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.

Thanks, applied.

Patch

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;
 	}