Compliation warning fixes

This commit is contained in:
Luca Deri
2020-02-08 11:24:40 +01:00
parent ff4f32ff48
commit 83bbb4cb69
+4 -4
View File
@@ -1518,9 +1518,9 @@ struct ndpi_proto ndpi_workflow_process_packet(struct ndpi_workflow * workflow,
return(nproto);
}
if(header->caplen < eth_offset + radio_len + sizeof((struct ndpi_wifi_header)) {
return(nproto);
}
if(header->caplen < (eth_offset + radio_len + sizeof(struct ndpi_wifi_header)))
return(nproto);
/* Calculate 802.11 header length (variable) */
wifi = (struct ndpi_wifi_header*)( packet + eth_offset + radio_len);
@@ -1564,7 +1564,7 @@ ether_type_check:
vlan_packet = 1;
// double tagging for 802.1Q
while((type == 0x8100) && (ip_offset < ((u_int16_t)header->caplen))) {
while((type == 0x8100) && (((bpf_u_int32)ip_offset) < header->caplen)) {
vlan_id = ((packet[ip_offset] << 8) + packet[ip_offset+1]) & 0xFFF;
type = (packet[ip_offset+2] << 8) + packet[ip_offset+3];
ip_offset += 4;