mirror of
https://github.com/mfontanini/libtins
synced 2026-01-29 21:14:28 +01:00
Done some fixes on Sniffer and Dot11Data.
This commit is contained in:
@@ -1233,8 +1233,13 @@ Dot11Data::Dot11Data(const uint8_t *buffer, uint32_t total_sz)
|
||||
buffer += _addr4.size();
|
||||
total_sz -= _addr4.size();
|
||||
}
|
||||
if(total_sz)
|
||||
inner_pdu(new Tins::SNAP(buffer, total_sz));
|
||||
if(total_sz) {
|
||||
// If the wep bit is on, then just use a RawPDU
|
||||
if(wep())
|
||||
inner_pdu(new Tins::RawPDU(buffer, total_sz));
|
||||
else
|
||||
inner_pdu(new Tins::SNAP(buffer, total_sz));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -73,6 +73,8 @@ PDU *BaseSniffer::next_packet() {
|
||||
ret = new EthernetII((const uint8_t*)content, header.caplen);
|
||||
else if(iface_type == DLT_IEEE802_11_RADIO)
|
||||
ret = new RadioTap((const uint8_t*)content, header.caplen);
|
||||
else if(iface_type == DLT_IEEE802_11)
|
||||
ret = Dot11::from_bytes((const uint8_t*)content, header.caplen);
|
||||
else if(iface_type == DLT_LOOP)
|
||||
ret = new Tins::Loopback((const uint8_t*)content, header.caplen);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user