af_packet: Hacked VLAN support.

This commit is contained in:
Jan Grashoefer 2020-09-25 18:42:47 +02:00 committed by Tim Wojtulewicz
parent b38894a329
commit 1fe008945e

View file

@ -245,11 +245,14 @@ bool AF_PacketSource::ExtractNextPacket(zeek::Packet* pkt)
pkt->Init(props.link_type, &current_hdr.ts, current_hdr.caplen, current_hdr.len, data); pkt->Init(props.link_type, &current_hdr.ts, current_hdr.caplen, current_hdr.len, data);
if ( current_hdr.len == 0 || current_hdr.caplen == 0 ) if ( packet->tp_status & TP_STATUS_VLAN_VALID )
{ pkt->vlan = packet->hv1.tp_vlan_tci;
Weird("empty_af_packet_header", pkt);
return false; if ( current_hdr.len == 0 || current_hdr.caplen == 0 )
} {
Weird("empty_af_packet_header", pkt);
return false;
}
stats.received++; stats.received++;
stats.bytes_received += current_hdr.len; stats.bytes_received += current_hdr.len;