Permalink
Browse files

Support long enough packets, reassembled or not

  • Loading branch information...
1 parent be037ab commit 2f3774326feaaeb664f62ee1be8b5b661eb72ef4 @wnagele wnagele committed Sep 2, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 hadoop-pcap-lib/src/main/java/net/ripe/hadoop/pcap/DnsPcapReader.java
@@ -45,7 +45,7 @@ protected void processPacketPayload(Packet packet, byte[] payload) {
if (DNS_PORT == (Integer)packet.get(Packet.SRC_PORT) || DNS_PORT == (Integer)packet.get(Packet.DST_PORT)) {
if (PROTOCOL_TCP.equals(packet.get(Packet.PROTOCOL)) &&
- packet.containsKey(Packet.REASSEMBLED_FRAGMENTS)) // TODO Support DNS responses with multiple messages (as used for XFRs)
+ payload.length > 2) // TODO Support DNS responses with multiple messages (as used for XFRs)
payload = Arrays.copyOfRange(payload, 2, payload.length); // First two bytes denote the size of the DNS message, ignore them
try {
Message msg = new Message(payload);

0 comments on commit 2f37743

Please sign in to comment.