]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
wlantest: Recognize hwsim_test packets
authorJouni Malinen <j@w1.fi>
Sun, 26 May 2013 19:19:52 +0000 (22:19 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 26 May 2013 19:19:52 +0000 (22:19 +0300)
Signed-hostap: Jouni Malinen <j@w1.fi>

wlantest/rx_ip.c

index 3192d128dfe3b22b40af28e1290aac59617017aa..19b338bb8f5a2b9af565be2074779136bfd387c9 100644 (file)
@@ -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),