From 83bbb4cb694d1f305258d4c4a5dc4174ef6526d1 Mon Sep 17 00:00:00 2001 From: Luca Deri Date: Sat, 8 Feb 2020 11:24:40 +0100 Subject: Compliation warning fixes --- example/reader_util.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/example/reader_util.c b/example/reader_util.c index cc44296d7..ae132fcff 100644 --- a/example/reader_util.c +++ b/example/reader_util.c @@ -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; -- cgit v1.2.3