fix ftp on tcp

This commit is contained in:
Campus
2016-09-22 18:59:56 +02:00
parent 730c8d6879
commit d601b0ce20
2 changed files with 48 additions and 45 deletions
+6 -6
View File
@@ -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) {