aboutsummaryrefslogtreecommitdiff
path: root/src/lib/protocols/socks45.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/protocols/socks45.c')
-rw-r--r--src/lib/protocols/socks45.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/src/lib/protocols/socks45.c b/src/lib/protocols/socks45.c
index 742e0a6e6..78a744087 100644
--- a/src/lib/protocols/socks45.c
+++ b/src/lib/protocols/socks45.c
@@ -40,12 +40,6 @@ static void ndpi_check_socks4(struct ndpi_detection_module_struct *ndpi_struct,
struct ndpi_packet_struct *packet = &ndpi_struct->packet;
u_int32_t payload_len = packet->payload_packet_len;
- /* Break after 10 packets. */
- if(flow->packet_counter > 10) {
- NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
- return;
- }
-
/* Check if we so far detected the protocol in the request or not. */
if(flow->socks4_stage == 0) {
NDPI_LOG_DBG2(ndpi_struct, "SOCKS4 stage 0: \n");
@@ -81,12 +75,6 @@ static void ndpi_check_socks5(struct ndpi_detection_module_struct *ndpi_struct,
struct ndpi_packet_struct *packet = &ndpi_struct->packet;
u_int32_t payload_len = packet->payload_packet_len;
- /* Break after 10 packets. */
- if(flow->packet_counter > 10) {
- NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
- return;
- }
-
/* Check if we so far detected the protocol in the request or not. */
if(flow->socks5_stage == 0) {
NDPI_LOG_DBG2(ndpi_struct, "SOCKS5 stage 0: \n");
@@ -123,6 +111,11 @@ static void ndpi_search_socks(struct ndpi_detection_module_struct *ndpi_struct,
{
NDPI_LOG_DBG(ndpi_struct, "search SOCKS\n");
+ if(flow->packet_counter >= 10) {
+ NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
+ return;
+ }
+
ndpi_check_socks4(ndpi_struct, flow);
if(flow->detected_protocol_stack[0] != NDPI_PROTOCOL_SOCKS)