Fix infinite loop when a custom rule has port 65535 (#1833)

Close #1829
This commit is contained in:
Ivan Nardi
2022-12-21 10:55:14 +01:00
committed by GitHub
parent 22821241e2
commit e9d5e72fb5
3 changed files with 3 additions and 2 deletions
+1
View File
@@ -7,6 +7,7 @@ tcp:860,udp:860,tcp:3260,udp:3260@iSCSI
tcp:3000@ntop
tcp:9002@Elasticsearch
tcp:5601@Kibana
tcp:65535@TestProto
#
# nBPF filters (https://github.com/ntop/PF_RING/tree/dev/userland/nbpf))
+1 -1
View File
@@ -604,7 +604,7 @@ static void addDefaultPort(struct ndpi_detection_module_struct *ndpi_str,
ndpi_default_ports_tree_node_t **root,
const char *_func,
int _line) {
u_int16_t port;
u_int32_t port;
for(port = range->port_low; port <= range->port_high; port++) {
ndpi_default_ports_tree_node_t *node =
+1 -1
View File
@@ -22,4 +22,4 @@ Patricia protocols: 0/0 (search/found)
HomeRouter 1 58 1
1 TCP 192.168.1.1:31337 -> 192.168.1.2:80 [proto: 335/HomeRouter][IP: 0/Unknown][ClearText][Confidence: nBPF][1 pkts/58 bytes -> 0 pkts/0 bytes][Goodput ratio: 7/0][< 1 sec][Plen Bins: 100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
1 TCP 192.168.1.1:31337 -> 192.168.1.2:80 [proto: 336/HomeRouter][IP: 0/Unknown][ClearText][Confidence: nBPF][1 pkts/58 bytes -> 0 pkts/0 bytes][Goodput ratio: 7/0][< 1 sec][Plen Bins: 100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]