diff mbox

Fix the injection of protected broadcast frames

Message ID 5182537B.1030204@gmail.com
State Accepted
Commit 409cd147b7a0685cbcae180c4d81526dd10b9159
Headers show

Commit Message

Krishna Chaitanya May 2, 2013, 11:52 a.m. UTC
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(-)

Comments

Jouni Malinen May 4, 2013, 8:37 a.m. UTC | #1
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.
diff mbox

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