diff options
author | Campus <campus@ntop.org> | 2016-11-12 16:35:25 +0100 |
---|---|---|
committer | Campus <campus@ntop.org> | 2016-11-12 16:35:25 +0100 |
commit | 48a206a4347d38f0bed322d194ce40076417ac59 (patch) | |
tree | 0c3349a86f167b984e27f54416e6a5d5e2a69c95 /src/lib/ndpi_main.c | |
parent | 4564b973df4fd6bbc90782ee98f80e459416b244 (diff) | |
parent | 3a6d2c7c5f28dacca0a99f0e122e10807cce22fb (diff) |
Merge branch 'alagoutte-scan-build' into dev
Diffstat (limited to 'src/lib/ndpi_main.c')
-rw-r--r-- | src/lib/ndpi_main.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c index 2f0b5c336..d1f522e84 100644 --- a/src/lib/ndpi_main.c +++ b/src/lib/ndpi_main.c @@ -2888,11 +2888,11 @@ static int ndpi_init_packet_header(struct ndpi_detection_module_struct *ndpi_str } #endif /* NDPI_DETECTION_SUPPORT_IPV6 */ - if(decaps_iph->version == 4 && decaps_iph->ihl >= 5) { + if(decaps_iph && decaps_iph->version == 4 && decaps_iph->ihl >= 5) { NDPI_LOG(NDPI_PROTOCOL_UNKNOWN, ndpi_struct, NDPI_LOG_DEBUG, "ipv4 header\n"); } #ifdef NDPI_DETECTION_SUPPORT_IPV6 - else if(decaps_iph->version == 6 && l3len >= sizeof(struct ndpi_ipv6hdr) && + else if(decaps_iph && decaps_iph->version == 6 && l3len >= sizeof(struct ndpi_ipv6hdr) && (ndpi_struct->ip_version_limit & NDPI_DETECTION_ONLY_IPV4) == 0) { NDPI_LOG(NDPI_PROTOCOL_UNKNOWN, ndpi_struct, NDPI_LOG_DEBUG, "ipv6 header\n"); flow->packet.iphv6 = (struct ndpi_ipv6hdr *)flow->packet.iph; |