diff options
author | Campus <campus@ntop.org> | 2017-04-20 23:00:11 +0200 |
---|---|---|
committer | Campus <campus@ntop.org> | 2017-04-20 23:00:11 +0200 |
commit | 9a94c34b91250643c383904b14352e282cfb056c (patch) | |
tree | 8484be7558800f9e9ab909b20d61b1a1805f8f08 /example/ndpi_util.c | |
parent | 6581579d37fedcf406d8e4e02315dc020ab26da3 (diff) |
fix for https://github.com/ntop/nDPI/issues/364
Diffstat (limited to 'example/ndpi_util.c')
-rw-r--r-- | example/ndpi_util.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/example/ndpi_util.c b/example/ndpi_util.c index 445ade1ac..d6be479a0 100644 --- a/example/ndpi_util.c +++ b/example/ndpi_util.c @@ -220,7 +220,7 @@ static struct ndpi_flow_info *get_ndpi_flow_info(struct ndpi_workflow * workflow return NULL; if((iph->ihl * 4) > ipsize || ipsize < ntohs(iph->tot_len) - || (iph->frag_off & htons(0x1FFF)) != 0) + /* || (iph->frag_off & htons(0x1FFF)) != 0 */) return NULL; l4_offset = iph->ihl * 4; @@ -521,6 +521,7 @@ static struct ndpi_proto packet_processing(struct ndpi_workflow * workflow, u_int16_t sport, dport, payload_len; u_int8_t *payload; u_int8_t src_to_dst_direction = 1; + struct ndpi_proto nproto = { NDPI_PROTOCOL_UNKNOWN, NDPI_PROTOCOL_UNKNOWN }; if(iph) flow = get_ndpi_flow_info(workflow, IPVERSION, vlan_id, iph, NULL, @@ -542,8 +543,10 @@ static struct ndpi_proto packet_processing(struct ndpi_workflow * workflow, ndpi_flow = flow->ndpi_flow; flow->packets++, flow->bytes += rawsize; flow->last_seen = time; - } else - return(flow->detected_protocol); + } else { // flow is NULL + workflow->stats.total_discarded_bytes++; + return (nproto); + } /* Protocol already detected */ if(flow->detection_completed) return(flow->detected_protocol); |