Merge branch 'dev' of https://github.com/ntop/nDPI into dev

This commit is contained in:
Campus
2016-05-24 23:33:13 +02:00
7 changed files with 125 additions and 37 deletions
-1
View File
@@ -135,7 +135,6 @@ static u_int8_t ndpi_int_search_bittorrent_tcp_zero(struct ndpi_detection_module
|| memcmp(packet->payload, "POST ", 5) == 0)) {
const u_int8_t *ptr = &packet->payload[4];
u_int16_t len = packet->payload_packet_len - 4;
a = 0;
/* parse complete get packet here into line structure elements */
+1 -4
View File
@@ -112,10 +112,8 @@ void ndpi_search_dns(struct ndpi_detection_module_struct *ndpi_struct, struct nd
ret_code = (is_query == 0) ? 0 : (dns_header.flags & 0x0F);
int j = 0;
int off = sizeof(struct ndpi_dns_packet_header) + 1;
while((flow->packet.payload[off] != '\0'))
while(flow->packet.payload[off] != '\0' && off < flow->packet.payload_packet_len)
{
if(off < flow->packet.payload_packet_len)
{
flow->host_server_name[j] = flow->packet.payload[off];
if(j < strlen((char*)flow->host_server_name)) {
if(flow->host_server_name[j] < ' ')
@@ -123,7 +121,6 @@ void ndpi_search_dns(struct ndpi_detection_module_struct *ndpi_struct, struct nd
j++;
}
off++;
}
}
flow->host_server_name[j] = '\0';
-1
View File
@@ -230,7 +230,6 @@ static void ndpi_check_ftp_data(struct ndpi_detection_module_struct *ndpi_struct
}
void ndpi_search_ftp_data(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) {
struct ndpi_packet_struct *packet = &flow->packet;
/* Break after 20 packets. */
if(flow->packet_counter > 20) {
-1
View File
@@ -48,7 +48,6 @@ void ndpi_search_rtcp(struct ndpi_detection_module_struct *ndpi_struct, struct n
offset += rtcp_section_len;
}
sport = ntohs(packet->udp->source), dport = ntohs(packet->udp->dest);
NDPI_LOG(NDPI_PROTOCOL_RTCP, ndpi_struct, NDPI_LOG_DEBUG, "calculating dport over udp.\n");
/* TODO changed a pair of length condition to the && from ||. Is it correct? */
if(((packet->payload_packet_len >= 28 && packet->payload_packet_len <= 1200) &&