Small fixes after latest commits (#1308)

This commit is contained in:
Ivan Nardi
2021-09-18 09:31:00 +02:00
committed by GitHub
parent 227e586e63
commit 994bd0696b
5 changed files with 14 additions and 13 deletions
+2 -1
View File
@@ -521,6 +521,7 @@ static void ndpi_search_dns(struct ndpi_detection_module_struct *ndpi_struct, st
if((flow->packet.detected_protocol_stack[0] == NDPI_PROTOCOL_DNS)
|| (flow->packet.detected_protocol_stack[1] == NDPI_PROTOCOL_DNS)) {
/* TODO: add support to RFC6891 to avoid some false positives */
if(flow->packet.udp != NULL && flow->packet.payload_packet_len > PKT_LEN_ALERT)
ndpi_set_risk(ndpi_struct, flow, NDPI_DNS_LARGE_PACKET);
@@ -529,7 +530,7 @@ static void ndpi_search_dns(struct ndpi_detection_module_struct *ndpi_struct, st
u_int8_t flags = ((u_int8_t*)flow->packet.iph)[6];
/* 0: fragmented; 1: not fragmented */
if((flags & 0xE0)
if((flags & 0x20)
|| (ndpi_iph_is_valid_and_not_fragmented(flow->packet.iph, flow->packet.l3_packet_len) == 0)) {
ndpi_set_risk(ndpi_struct, flow, NDPI_DNS_FRAGMENTED);
}
+1 -1
View File
@@ -202,7 +202,7 @@ int quic_len(const uint8_t *buf, uint64_t *value)
/* Necessary as simple cast crashes on ARM */
memcpy(&n, buf, sizeof(u_int64_t));
*value = ndpi_ntohll(n & 0x3FFFFFFFFFFFFFFF);
*value = ndpi_ntohll(n) & 0x3FFFFFFFFFFFFFFF;
}
return 8;
default: /* No Possible */