diff options
Diffstat (limited to 'src/lib/protocols/dns.c')
-rw-r--r-- | src/lib/protocols/dns.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/lib/protocols/dns.c b/src/lib/protocols/dns.c index e75449fe4..0e5855016 100644 --- a/src/lib/protocols/dns.c +++ b/src/lib/protocols/dns.c @@ -628,12 +628,11 @@ static int is_valid_dns(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_dns_packet_header *dns_header, u_int payload_offset, u_int8_t *is_query) { struct ndpi_packet_struct *packet = &ndpi_struct->packet; - u_int x = payload_offset; if(packet->payload_packet_len < sizeof(struct ndpi_dns_packet_header) + payload_offset) return 0; - memcpy(dns_header, (struct ndpi_dns_packet_header*)&packet->payload[x], + memcpy(dns_header, (struct ndpi_dns_packet_header*)&packet->payload[payload_offset], sizeof(struct ndpi_dns_packet_header)); dns_header->tr_id = ntohs(dns_header->tr_id); @@ -643,8 +642,6 @@ static int is_valid_dns(struct ndpi_detection_module_struct *ndpi_struct, dns_header->authority_rrs = ntohs(dns_header->authority_rrs); dns_header->additional_rrs = ntohs(dns_header->additional_rrs); - x += sizeof(struct ndpi_dns_packet_header); - if((dns_header->flags & FLAGS_MASK) == 0x0000) *is_query = 1; else |