Compilation fixes

This commit is contained in:
Luca Deri
2020-04-20 15:08:51 +02:00
parent 97badc574b
commit 25cd2a23a6
+3 -3
View File
@@ -1694,15 +1694,13 @@ ether_type_check:
iph6 = (struct ndpi_ipv6hdr *)&packet[ip_offset]; iph6 = (struct ndpi_ipv6hdr *)&packet[ip_offset];
proto = iph6->ip6_hdr.ip6_un1_nxt; proto = iph6->ip6_hdr.ip6_un1_nxt;
ip_len = ntohs(iph6->ip6_hdr.ip6_un1_plen); ip_len = ntohs(iph6->ip6_hdr.ip6_un1_plen);
if (header->caplen < ip_offset + sizeof(struct ndpi_ipv6hdr + ntohs(iph_v6->ip6_hdr.ip6_un1_plen)) if(header->caplen < (ip_offset + sizeof(struct ndpi_ipv6hdr) + ntohs(iph6->ip6_hdr.ip6_un1_plen)))
return(nproto); /* Too short for IPv6 payload*/ return(nproto); /* Too short for IPv6 payload*/
const u_int8_t *l4ptr = (((const u_int8_t *) iph6) + sizeof(struct ndpi_ipv6hdr)); const u_int8_t *l4ptr = (((const u_int8_t *) iph6) + sizeof(struct ndpi_ipv6hdr));
if(ndpi_handle_ipv6_extension_headers(NULL, &l4ptr, &ip_len, &proto) != 0) { if(ndpi_handle_ipv6_extension_headers(NULL, &l4ptr, &ip_len, &proto) != 0) {
return(nproto); return(nproto);
} }
iph6->ip6_hdr.ip6_un1_nxt = proto;
iph = NULL; iph = NULL;
} else { } else {
@@ -1722,6 +1720,7 @@ ether_type_check:
if(workflow->prefs.decode_tunnels && (proto == IPPROTO_UDP)) { if(workflow->prefs.decode_tunnels && (proto == IPPROTO_UDP)) {
if(header->caplen < ip_offset + ip_len + sizeof(struct ndpi_udphdr)) if(header->caplen < ip_offset + ip_len + sizeof(struct ndpi_udphdr))
return(nproto); /* Too short for UDP header*/ return(nproto); /* Too short for UDP header*/
else {
struct ndpi_udphdr *udp = (struct ndpi_udphdr *)&packet[ip_offset+ip_len]; struct ndpi_udphdr *udp = (struct ndpi_udphdr *)&packet[ip_offset+ip_len];
u_int16_t sport = ntohs(udp->source), dport = ntohs(udp->dest); u_int16_t sport = ntohs(udp->source), dport = ntohs(udp->dest);
@@ -1815,6 +1814,7 @@ ether_type_check:
} }
} }
} }
}
/* process the packet */ /* process the packet */
return(packet_processing(workflow, time, vlan_id, tunnel_type, iph, iph6, return(packet_processing(workflow, time, vlan_id, tunnel_type, iph, iph6,