aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--example/ndpiReader.c6
-rw-r--r--tests/result/sip.pcap.out4
2 files changed, 5 insertions, 5 deletions
diff --git a/example/ndpiReader.c b/example/ndpiReader.c
index 0bfab3868..ea7583494 100644
--- a/example/ndpiReader.c
+++ b/example/ndpiReader.c
@@ -3184,6 +3184,7 @@ void bpf_filter_pkt_peak_filter(json_object **jObj_bpfFilter,
snprintf(&filter[l], sizeof(filter)-l, "%d", port_array[i]);
else
snprintf(&filter[l], sizeof(filter)-l, "%d or ", port_array[i]);
+
i++;
}
@@ -3197,11 +3198,10 @@ void bpf_filter_pkt_peak_filter(json_object **jObj_bpfFilter,
int l;
if(port_array[0] != INIT_VAL)
- strncat(filter, " and not (src ", sizeof(filter)/sizeof(char));
+ strncat(filter, " and not (src ", sizeof(filter)-strlen(filter));
else
strcpy(filter, "not (src ");
-
i=0;
while(i < sh_size && src_host_array[i] != NULL) {
l = strlen(filter);
@@ -3224,7 +3224,7 @@ void bpf_filter_pkt_peak_filter(json_object **jObj_bpfFilter,
int l;
if(port_array[0] != INIT_VAL || src_host_array[0] != NULL)
- strncat(filter, " and not (dst ", sizeof(filter)/sizeof(char));
+ strncat(filter, " and not (dst ", sizeof(filter)-strlen(filter));
else
strcpy(filter, "not (dst ");
diff --git a/tests/result/sip.pcap.out b/tests/result/sip.pcap.out
index 103162133..b17a36bca 100644
--- a/tests/result/sip.pcap.out
+++ b/tests/result/sip.pcap.out
@@ -1,8 +1,8 @@
RTP 9 1926 1
SIP 102 47087 2
-WhatsAppVoice 1 146 1
+RTCP 1 146 1
1 UDP 192.168.1.2:5060 <-> 212.242.33.35:5060 [proto: 100/SIP][cat: VoIP/10][53 pkts/21940 bytes <-> 31 pkts/15635 bytes][PLAIN TEXT (REGISTER sip)]
2 UDP 192.168.1.2:5060 <-> 200.68.120.81:5060 [proto: 100/SIP][cat: VoIP/10][15 pkts/7568 bytes <-> 3 pkts/1944 bytes][PLAIN TEXT (INVITE sip)]
3 UDP 192.168.1.2:30000 -> 212.242.33.36:40392 [proto: 87/RTP][cat: Media/1][9 pkts/1926 bytes -> 0 pkts/0 bytes][PLAIN TEXT (VRUDKBuYs)]
- 4 UDP 192.168.1.2:30001 -> 212.242.33.36:40393 [proto: 189/WhatsAppVoice][cat: VoIP/10][1 pkts/146 bytes -> 0 pkts/0 bytes][PLAIN TEXT (8@192.168.1.2)]
+ 4 UDP 192.168.1.2:30001 -> 212.242.33.36:40393 [proto: 165/RTCP][cat: VoIP/10][1 pkts/146 bytes -> 0 pkts/0 bytes][PLAIN TEXT (8@192.168.1.2)]