From 2411d24c876eb1fe3eee204ea88aef17ddad3d3b Mon Sep 17 00:00:00 2001 From: Andrew Zaborowski Date: Tue, 14 Mar 2017 00:51:21 +0100 Subject: [PATCH] hwsim: Don't require full mpdu_mgmt_header in frames Don't require the full length of a Management MPDU as a condition to forward the frame, only require data up to the three addresses we need to know where to forward the frame. This check was failing with some frames during a deauthentication. We could possibly forward shorter frames too if needed (send to all possible recipients.) --- tools/hwsim.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/hwsim.c b/tools/hwsim.c index 28e38c5f..837e16d6 100644 --- a/tools/hwsim.c +++ b/tools/hwsim.c @@ -1258,8 +1258,8 @@ static void unicast_handler(struct l_genl_msg *msg, void *user_data) if (len > IEEE80211_MAX_DATA_LEN) break; - if (len < sizeof(struct mpdu_fc) + - sizeof(struct mpdu_mgmt_header)) { + /* Duration + Address1 + Address2 + Address3 + SeqCtl */ + if (len < sizeof(struct mpdu_fc) + 22) { l_error("Frame payload too short for header"); break; }