Improvements for DNS continuous flow dissection

This commit is contained in:
Luca
2020-02-06 19:19:36 +01:00
parent 4613515635
commit 452ba1f339
+1 -7
View File
@@ -201,7 +201,7 @@ static int search_valid_dns(struct ndpi_detection_module_struct *ndpi_struct,
if((flow->packet.detected_protocol_stack[0] == NDPI_PROTOCOL_DNS) if((flow->packet.detected_protocol_stack[0] == NDPI_PROTOCOL_DNS)
|| (flow->packet.detected_protocol_stack[1] == NDPI_PROTOCOL_DNS)) { || (flow->packet.detected_protocol_stack[1] == NDPI_PROTOCOL_DNS)) {
/* Request already set the protocol */ /* Request already set the protocol */
flow->extra_packets_func = NULL; /* We're good now */ // flow->extra_packets_func = NULL; /* Removed so the caller can keep dissecting DNS flows */
} else { } else {
/* We missed the request */ /* We missed the request */
u_int16_t s_port = flow->packet.udp ? ntohs(flow->packet.udp->source) : ntohs(flow->packet.tcp->source); u_int16_t s_port = flow->packet.udp ? ntohs(flow->packet.udp->source) : ntohs(flow->packet.tcp->source);
@@ -224,12 +224,6 @@ static int search_dns_again(struct ndpi_detection_module_struct *ndpi_struct, st
/* possibly dissect the DNS reply */ /* possibly dissect the DNS reply */
ndpi_search_dns(ndpi_struct, flow); ndpi_search_dns(ndpi_struct, flow);
if(flow->protos.dns.num_answers > 0) {
/* stop extra processing */
flow->extra_packets_func = NULL; /* We're good now */
return(0);
}
/* Possibly more processing */ /* Possibly more processing */
return(1); return(1);
} }