From: Robert Edmonds Date: Sat, 16 Apr 2016 00:36:19 +0000 (-0400) Subject: dnspcap: Decode IPv6 packets in DLT_RAW captures correctly X-Git-Tag: dnsdist-1.0.0~9^2~4 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3ae047fe009d35c4ad62f09c08d68f94225b9d7c;p=pdns dnspcap: Decode IPv6 packets in DLT_RAW captures correctly DLT_RAW captures (linktype 101) were not handling IPv6 packets correctly. For DLT_RAW, PcapPacketReader::getUDPPacket() synthesizes a fake ethertype value (the "contentCode" variable), but for IPv6 it was incorrectly set to 0x0806 (ARP) instead of 0x86dd (IPv6). This caused IPv6 packets to silently be discarded. --- diff --git a/pdns/dnspcap.cc b/pdns/dnspcap.cc index 0280d702f..3366e70a9 100644 --- a/pdns/dnspcap.cc +++ b/pdns/dnspcap.cc @@ -88,7 +88,7 @@ try if(d_ip->ip_v==4) contentCode = 0x0800; else - contentCode = 0x0806; + contentCode = 0x86dd; } else if(d_pfh.linktype==113) contentCode=ntohs(d_lcc->lcc_protocol);