aboutsummaryrefslogtreecommitdiffstats
path: root/wlantest
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2013-05-26 19:19:52 (GMT)
committerJouni Malinen <j@w1.fi>2013-05-26 19:19:52 (GMT)
commit3b5a1a776980a20fcff0bc99f2a24028dee28858 (patch)
tree95664a312c208053c58405d6776b2438111a149d /wlantest
parentace4e460e52bb2195999e155be6c256280e26a07 (diff)
downloadhostap-3b5a1a776980a20fcff0bc99f2a24028dee28858.zip
hostap-3b5a1a776980a20fcff0bc99f2a24028dee28858.tar.gz
hostap-3b5a1a776980a20fcff0bc99f2a24028dee28858.tar.bz2
wlantest: Recognize hwsim_test packets
Signed-hostap: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'wlantest')
-rw-r--r--wlantest/rx_ip.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/wlantest/rx_ip.c b/wlantest/rx_ip.c
index 3192d12..19b338b 100644
--- a/wlantest/rx_ip.c
+++ b/wlantest/rx_ip.c
@@ -96,6 +96,22 @@ static void rx_data_icmp(struct wlantest *wt, const u8 *bssid,
}
+static int hwsim_test_packet(const u8 *data, size_t len)
+{
+ size_t i;
+
+ if (len != 1500 - 14)
+ return 0;
+
+ for (i = 0; i < len; i++) {
+ if (data[i] != (i & 0xff))
+ return 0;
+ }
+
+ return 1;
+}
+
+
void rx_data_ip(struct wlantest *wt, const u8 *bssid, const u8 *sta_addr,
const u8 *dst, const u8 *src, const u8 *data, size_t len,
const u8 *peer_addr)
@@ -109,6 +125,10 @@ void rx_data_ip(struct wlantest *wt, const u8 *bssid, const u8 *sta_addr,
if (len < sizeof(*ip))
return;
if (ip->version != 4) {
+ if (hwsim_test_packet(data, len)) {
+ add_note(wt, MSG_INFO, "hwsim_test package");
+ return;
+ }
add_note(wt, MSG_DEBUG, "Unexpected IP protocol version %u in "
"IPv4 packet (bssid=" MACSTR " str=" MACSTR
" dst=" MACSTR ")", ip->version, MAC2STR(bssid),