]> granicus.if.org Git - pdns/commitdiff
dnspcap: Decode IPv6 packets in DLT_RAW captures correctly
authorRobert Edmonds <edmonds@fsi.io>
Sat, 16 Apr 2016 00:36:19 +0000 (20:36 -0400)
committerRobert Edmonds <edmonds@fsi.io>
Sat, 16 Apr 2016 00:36:19 +0000 (20:36 -0400)
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.

pdns/dnspcap.cc

index 0280d702f7359379ab74d0ed8ea0301909bcfbb7..3366e70a9ae8396e8e39b2cff9d579866d8ea1c4 100644 (file)
@@ -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);