aboutsummaryrefslogtreecommitdiffstats
path: root/wlantest/process.c
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2013-01-17 10:55:30 (GMT)
committerJouni Malinen <j@w1.fi>2013-01-17 10:55:30 (GMT)
commit25315176008ba41ac20b00d748ae75e5869f890f (patch)
treefd079490d14b0ca97238276ebe64c2d769249e17 /wlantest/process.c
parentdc013f1e37df3462085cf01a13f0c432f146ad7a (diff)
downloadhostap-25315176008ba41ac20b00d748ae75e5869f890f.zip
hostap-25315176008ba41ac20b00d748ae75e5869f890f.tar.gz
hostap-25315176008ba41ac20b00d748ae75e5869f890f.tar.bz2
wlantest: Add -F option for assuming FCS is included
When using DLT_IEEE802_11 datalink type in a pcap file, wlantest can now be instructed to assume there is an FCS included in the frame by adding the new -F command line argument. This will make wlantest validate the FCS and strip it from the frame before processing. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'wlantest/process.c')
-rw-r--r--wlantest/process.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/wlantest/process.c b/wlantest/process.c
index 609a23a..a788a36 100644
--- a/wlantest/process.c
+++ b/wlantest/process.c
@@ -380,5 +380,19 @@ void wlantest_process_prism(struct wlantest *wt, const u8 *data, size_t len)
void wlantest_process_80211(struct wlantest *wt, const u8 *data, size_t len)
{
wpa_hexdump(MSG_EXCESSIVE, "Process data", data, len);
+
+ if (wt->assume_fcs && len >= 4) {
+ const u8 *fcspos;
+
+ len -= 4;
+ fcspos = data + len;
+ if (check_fcs(data, len, fcspos) < 0) {
+ wpa_printf(MSG_EXCESSIVE, "Drop RX frame with invalid "
+ "FCS");
+ wt->fcs_error++;
+ return;
+ }
+ }
+
rx_frame(wt, data, len);
}