You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@drill.apache.org by bo...@apache.org on 2020/01/02 16:31:56 UTC
[drill] 01/05: DRILL-7505: PCAP Plugin Fails on IPv6 Packets
This is an automated email from the ASF dual-hosted git repository.
bohdan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/drill.git
commit a00d70db4c3d63eeaec03deb94070ff494a12b64
Author: Charles Givre <cg...@apache.org>
AuthorDate: Tue Dec 31 18:55:59 2019 -0500
DRILL-7505: PCAP Plugin Fails on IPv6 Packets
closes #1946
---
.../main/java/org/apache/drill/exec/store/pcap/decoder/Packet.java | 4 +++-
.../org/apache/drill/exec/store/pcap/decoder/PacketConstants.java | 3 +++
.../org/apache/drill/exec/store/pcapng/decoder/PacketDecoder.java | 2 +-
.../test/java/org/apache/drill/exec/store/pcap/TestPcapDecoder.java | 1 -
4 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/store/pcap/decoder/Packet.java b/exec/java-exec/src/main/java/org/apache/drill/exec/store/pcap/decoder/Packet.java
index 148f94f..befa7d9 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/store/pcap/decoder/Packet.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/store/pcap/decoder/Packet.java
@@ -513,12 +513,14 @@ public class Packet implements Comparable<Packet> {
case PacketConstants.AUTHENTICATION_V6:
case PacketConstants.ENCAPSULATING_SECURITY_V6:
case PacketConstants.MOBILITY_EXTENSION_V6:
+ case PacketConstants.HOST_IDENTITY_PROTOCOL:
+ case PacketConstants.SHIM6_PROTOCOL:
nextHeader = getByte(raw, ipOffset + headerLength);
headerLength += (getByte(raw, ipOffset + headerLength) + 1) * 8;
break;
default:
//noinspection ConstantConditions
- Preconditions.checkState(false, "Unknown V6 extension or protocol: ", nextHeader);
+ logger.warn("Unknown V6 extension or protocol: {}", nextHeader);
return getByte(raw, ipOffset + headerLength);
}
}
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/store/pcap/decoder/PacketConstants.java b/exec/java-exec/src/main/java/org/apache/drill/exec/store/pcap/decoder/PacketConstants.java
index 6f29253..9525d3e 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/store/pcap/decoder/PacketConstants.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/store/pcap/decoder/PacketConstants.java
@@ -41,6 +41,9 @@ public final class PacketConstants {
public static final int AUTHENTICATION_V6 = 51;
public static final int ENCAPSULATING_SECURITY_V6 = 50;
public static final int MOBILITY_EXTENSION_V6 = 135;
+ public static final int HOST_IDENTITY_PROTOCOL = 139;
+ public static final int SHIM6_PROTOCOL = 140;
+
public static final int NO_NEXT_HEADER = 59;
public static final int UDP_HEADER_LENGTH = 8;
public static final int VER_IHL_OFFSET = 14;
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/store/pcapng/decoder/PacketDecoder.java b/exec/java-exec/src/main/java/org/apache/drill/exec/store/pcapng/decoder/PacketDecoder.java
index ea5d831..6845c43 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/store/pcapng/decoder/PacketDecoder.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/store/pcapng/decoder/PacketDecoder.java
@@ -54,7 +54,7 @@ public class PacketDecoder extends Packet {
protected int processIpV6Packet() {
try {
return super.processIpV6Packet();
- } catch (IllegalStateException ise) {
+ } catch (IllegalStateException | ArrayIndexOutOfBoundsException e) {
return -1;
}
}
diff --git a/exec/java-exec/src/test/java/org/apache/drill/exec/store/pcap/TestPcapDecoder.java b/exec/java-exec/src/test/java/org/apache/drill/exec/store/pcap/TestPcapDecoder.java
index 54021d2..1a29902 100644
--- a/exec/java-exec/src/test/java/org/apache/drill/exec/store/pcap/TestPcapDecoder.java
+++ b/exec/java-exec/src/test/java/org/apache/drill/exec/store/pcap/TestPcapDecoder.java
@@ -211,7 +211,6 @@ public class TestPcapDecoder extends BaseTestQuery {
logger.info("\n\n\n");
}
-
/**
* Creates an ephemeral file of about a GB in size
*