From d58b614e67c87cfc4bc99cb43fb533f5a8c74fb3 Mon Sep 17 00:00:00 2001 From: Srivats P Date: Thu, 16 Feb 2017 21:32:01 +0530 Subject: [PATCH] sign: Exclude ICMP packets from Rx Stream Stats --- server/pcaprxstats.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/server/pcaprxstats.cpp b/server/pcaprxstats.cpp index 0ba56f2..139ed65 100644 --- a/server/pcaprxstats.cpp +++ b/server/pcaprxstats.cpp @@ -45,9 +45,19 @@ void PcapRxStats::run() int flags = PCAP_OPENFLAG_PROMISCUOUS; char errbuf[PCAP_ERRBUF_SIZE] = ""; struct bpf_program bpf; - QString capture_filter = QString("ether[len - 4:4] == 0x%1").arg( - SignProtocol::magic(), 0, BASE_HEX); const int optimize = 1; + QString capture_filter = QString("(ether[len - 4:4] == 0x%1)").arg( + SignProtocol::magic(), 0, BASE_HEX); + // XXX: Exclude ICMP packets which contain an embedded signed packet + // For now we check upto 4 vlan tags + capture_filter.append( + "and not (" + "icmp or " + "(vlan and icmp) or " + "(vlan and icmp) or " + "(vlan and icmp) or " + "(vlan and icmp) " + ")"); qDebug("In %s", __PRETTY_FUNCTION__);