mirror of
https://github.com/zeek/zeek.git
synced 2025-10-16 05:28:20 +00:00
Add extra guard against non-IP, non-ARP packets being parsed as IPv6.
This would usually manifest in raising truncated_IP weirds, which is misleading because it wasn't actually an IP packet in the first place. Now unknown_packet_type weird is raised instead.
This commit is contained in:
parent
1f58ac875b
commit
4cb6a279f5
1 changed files with 6 additions and 1 deletions
|
@ -282,11 +282,16 @@ void NetSessions::NextPacket(double t, const struct pcap_pkthdr* hdr,
|
|||
else if ( arp_analyzer && arp_analyzer->IsARP(pkt, hdr_size) )
|
||||
arp_analyzer->NextPacket(t, hdr, pkt, hdr_size);
|
||||
|
||||
else
|
||||
else if ( ip->ip_v == 6 )
|
||||
{
|
||||
IP_Hdr ip_hdr((const struct ip6_hdr*) (pkt + hdr_size));
|
||||
DoNextPacket(t, hdr, &ip_hdr, pkt, hdr_size);
|
||||
}
|
||||
else
|
||||
{
|
||||
Weird("unknown_packet_type", hdr, pkt);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if ( dump_this_packet && ! record_all_packets )
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue