diff --git a/src/iosource/Packet.cc b/src/iosource/Packet.cc index 91bba76ba6..fedb795885 100644 --- a/src/iosource/Packet.cc +++ b/src/iosource/Packet.cc @@ -86,6 +86,9 @@ int Packet::GetLinkHeaderSize(int link_type) case DLT_PPP_SERIAL: // PPP_SERIAL return 4; + case DLT_IEEE802_11: // 802.11 monitor + return 34; + case DLT_IEEE802_11_RADIO: // 802.11 plus RadioTap return 59; @@ -279,12 +282,15 @@ void Packet::ProcessLayer2() } pdata += rtheader_len; + } + case DLT_IEEE802_11: + { u_char len_80211 = 24; // minimal length of data frames if ( pdata + len_80211 >= end_of_data ) { - Weird("truncated_radiotap_header"); + Weird("truncated_802_11_header"); return; } @@ -316,7 +322,7 @@ void Packet::ProcessLayer2() if ( pdata + len_80211 >= end_of_data ) { - Weird("truncated_radiotap_header"); + Weird("truncated_802_11_header"); return; } @@ -349,7 +355,7 @@ void Packet::ProcessLayer2() if ( pdata + 8 >= end_of_data ) { - Weird("truncated_radiotap_header"); + Weird("truncated_802_11_header"); return; } // Check that the DSAP and SSAP are both SNAP and that the control @@ -374,9 +380,11 @@ void Packet::ProcessLayer2() l3_proto = L3_IPV4; else if ( protocol == 0x86DD ) l3_proto = L3_IPV6; + else if ( protocol == 0x0806 || protocol == 0x8035 ) + l3_proto = L3_ARP; else { - Weird("non_ip_packet_in_ieee802_11_radio_encapsulation"); + Weird("non_ip_packet_in_ieee802_11"); return; } pdata += 2; diff --git a/testing/btest/Baseline/core.wlanmon/conn.log b/testing/btest/Baseline/core.wlanmon/conn.log new file mode 100644 index 0000000000..72161c6d47 --- /dev/null +++ b/testing/btest/Baseline/core.wlanmon/conn.log @@ -0,0 +1,11 @@ +#separator \x09 +#set_separator , +#empty_field (empty) +#unset_field - +#path conn +#open 2018-05-15-16-59-00 +#fields ts uid id.orig_h id.orig_p id.resp_h id.resp_p proto service duration orig_bytes resp_bytes conn_state local_orig local_resp missed_bytes history orig_pkts orig_ip_bytes resp_pkts resp_ip_bytes tunnel_parents +#types time string addr port addr port enum string interval count count string bool bool count string count count count count set[string] +1526399270.280018 CHhAvVGS1DHFjwGM9 172.17.156.76 61738 208.67.220.220 53 udp dns 0.009303 35 128 SF - - 0 Dd 1 63 1 156 - +1526399270.293114 ClEkJM2Vm5giqnMf4h fe80::a667:6ff:fef7:ec54 5353 ff02::fb 5353 udp dns - - - S0 - - 0 D 1 328 0 0 - +#close 2018-05-15-16-59-00 diff --git a/testing/btest/Traces/wlanmon.pcap b/testing/btest/Traces/wlanmon.pcap new file mode 100644 index 0000000000..a940ea1046 Binary files /dev/null and b/testing/btest/Traces/wlanmon.pcap differ diff --git a/testing/btest/core/wlanmon.bro b/testing/btest/core/wlanmon.bro new file mode 100644 index 0000000000..b227baf7eb --- /dev/null +++ b/testing/btest/core/wlanmon.bro @@ -0,0 +1,2 @@ +# @TEST-EXEC: bro -C -r $TRACES/wlanmon.pcap +# @TEST-EXEC: btest-diff conn.log