aboutsummaryrefslogtreecommitdiff
path: root/src/lib/protocols/ftp_data.c
diff options
context:
space:
mode:
authorCampus <campus@ntop.org>2016-09-22 18:59:56 +0200
committerCampus <campus@ntop.org>2016-09-22 18:59:56 +0200
commitd601b0ce205acd9e7b699de2767c6ddac6ed8918 (patch)
treeeeb0218eb651d59d8f2d99ae4cef471526ee8b55 /src/lib/protocols/ftp_data.c
parent730c8d68793e3c9e1ea84b078a7674e68aa5ae2c (diff)
fix ftp on tcp
Diffstat (limited to 'src/lib/protocols/ftp_data.c')
-rw-r--r--src/lib/protocols/ftp_data.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/lib/protocols/ftp_data.c b/src/lib/protocols/ftp_data.c
index 7daf9190d..47b45ec4c 100644
--- a/src/lib/protocols/ftp_data.c
+++ b/src/lib/protocols/ftp_data.c
@@ -1,8 +1,7 @@
/*
* ftp_data.c
*
- * Copyright (C) 2014 Tomasz Bujlow <tomasz@skatnet.dk>
- * Copyright (C) 2014 - ntop.org
+ * Copyright (C) 2016 - ntop.org
*
* The signature is based on the Libprotoident library.
*
@@ -34,12 +33,13 @@ static void ndpi_int_ftp_data_add_connection(struct ndpi_detection_module_struct
static int ndpi_match_ftp_data_port(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) {
struct ndpi_packet_struct *packet = &flow->packet;
- if(packet->tcp->dest == htons(20) || packet->tcp->source == htons(20)) {
- return 1;
+ /* Check connection over TCP */
+ if(packet->tcp) {
+ if(packet->tcp->dest == htons(20) || packet->tcp->source == htons(20)) {
+ return 1;
+ }
}
-
return 0;
-
}
static int ndpi_match_ftp_data_directory(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) {