When it is range-based and it is more than 2 packets, we do range-based; when it...
[pingpong.git] / Code / Projects / PacketLevelSignatureExtractor / src / main / java / edu / uci / iotproject / util / PcapPacketUtils.java
index de89dc4b3115a9b488b1f458328821452fe1fc26..fc5234e6e32a01f312690241601f27847a7f04dd 100644 (file)
@@ -674,7 +674,10 @@ public final class PcapPacketUtils {
         // Get the ranges of the two signatures
         List<List<List<PcapPacket>>> signatureRanges = getSequenceRanges(signature);
         List<List<List<PcapPacket>>> otherSignatureRanges = getSequenceRanges(otherSignature);
-        if (!isRangeBased(signatureRanges) && !isRangeBased(otherSignatureRanges)) {
+        if (signature.size() == 1 && signature.get(0).get(0).size() == 2) {
+            // The signature only has 2 packets
+            return true;
+        } else if (!isRangeBased(signatureRanges) && !isRangeBased(otherSignatureRanges)) {
             // Conservative checking when there is no range
             return true;
         } else if(signatureRanges.size() != otherSignatureRanges.size()) {