Compilation fix

This commit is contained in:
Luca Deri
2020-02-28 16:03:27 +01:00
parent 8f45f51e6c
commit 34ad06fef5
+3 -1
View File
@@ -1359,7 +1359,7 @@ static struct ndpi_proto packet_processing(struct ndpi_workflow * workflow,
return(nproto); return(nproto);
} }
if(!flow->detection_completed && payload_len > 0) { if(!flow->detection_completed) {
u_int enough_packets = u_int enough_packets =
(((proto == IPPROTO_UDP) && ((flow->src2dst_packets + flow->dst2src_packets) > max_num_udp_dissected_pkts)) (((proto == IPPROTO_UDP) && ((flow->src2dst_packets + flow->dst2src_packets) > max_num_udp_dissected_pkts))
|| ((proto == IPPROTO_TCP) && ((flow->src2dst_packets + flow->dst2src_packets) > max_num_tcp_dissected_pkts))) ? 1 : 0; || ((proto == IPPROTO_TCP) && ((flow->src2dst_packets + flow->dst2src_packets) > max_num_tcp_dissected_pkts))) ? 1 : 0;
@@ -1709,8 +1709,10 @@ ether_type_check:
} }
if(workflow->prefs.decode_tunnels && (proto == IPPROTO_UDP)) { if(workflow->prefs.decode_tunnels && (proto == IPPROTO_UDP)) {
#if LUCA
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*/
#endif
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);