TcpReassembler: skip non-IPv4 traffic; SignatureDetector: add paths to d-link evaluat...
authorJanus Varmarken <varmarken@gmail.com>
Tue, 9 Oct 2018 17:31:13 +0000 (10:31 -0700)
committerJanus Varmarken <varmarken@gmail.com>
Tue, 9 Oct 2018 17:34:56 +0000 (10:34 -0700)
Code/Projects/SmartPlugDetector/src/main/java/edu/uci/iotproject/TcpReassembler.java

index c61223d..70c096a 100644 (file)
@@ -9,6 +9,7 @@ import java.util.*;
 
 /**
  * Reassembles TCP conversations (streams).
+ * <b>Note: current version only supports TCP over IPv4.</b>
  *
  * @author Janus Varmarken {@literal <jvarmark@uci.edu>}
  * @author Rahmadi Trimananda {@literal <rtrimana@uci.edu>}
@@ -39,8 +40,9 @@ public class TcpReassembler implements PacketListener {
 
     @Override
     public void gotPacket(PcapPacket pcapPacket) {
+        IpV4Packet ipPacket = pcapPacket.get(IpV4Packet.class);
         TcpPacket tcpPacket = pcapPacket.get(TcpPacket.class);
-        if (tcpPacket == null) {
+        if (ipPacket == null || tcpPacket == null) {
             return;
         }
         // ... TODO?