diff options
author | Luca Deri <deri@ntop.org> | 2019-09-29 08:10:12 +0200 |
---|---|---|
committer | Luca Deri <deri@ntop.org> | 2019-09-29 08:10:12 +0200 |
commit | 53ea3481ea15489c6b9b185352a7bf9d97d5ce4f (patch) | |
tree | ef14c8f4984f58fc7d2255fff298d1b81bef8122 /example | |
parent | 59b83999239ad7154f0fec418ef657bfd6c051e0 (diff) |
Fixed ICMP parsing bug introduced by pull #770
Diffstat (limited to 'example')
-rw-r--r-- | example/reader_util.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/example/reader_util.c b/example/reader_util.c index 2fdf14b35..1a8fb2a1d 100644 --- a/example/reader_util.c +++ b/example/reader_util.c @@ -713,10 +713,12 @@ static struct ndpi_flow_info *get_ndpi_flow_info(struct ndpi_workflow * workflow *payload = (u_int8_t*)&l4[sizeof(struct ndpi_icmphdr )]; *payload_len = (l4_packet_len > sizeof(struct ndpi_icmphdr)) ? l4_packet_len-sizeof(struct ndpi_icmphdr) : 0; l4_data_len = l4_packet_len - sizeof(struct ndpi_icmphdr); + *sport = *dport = 0; } else if (*proto == IPPROTO_ICMPV6) { *payload = (u_int8_t*)&l4[sizeof(struct ndpi_icmp6hdr)]; *payload_len = (l4_packet_len > sizeof(struct ndpi_icmp6hdr)) ? l4_packet_len-sizeof(struct ndpi_icmp6hdr) : 0; l4_data_len = l4_packet_len - sizeof(struct ndpi_icmp6hdr); + *sport = *dport = 0; } else { // non tcp/udp protocols *sport = *dport = 0; |