diff options
author | Luca Deri <lucaderi@users.noreply.github.com> | 2024-08-21 12:21:03 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-21 12:21:03 +0200 |
commit | d6bde4bcd90291351833be09fd0bb0eccc75824b (patch) | |
tree | b804956f37dd154efe39d8e88debb510f4452ddb /src | |
parent | 5610145c6c2f0aebd6adee7717145ab44c29f848 (diff) |
Removed unnecessary includes (#2525)
Diffstat (limited to 'src')
-rw-r--r-- | src/include/ndpi_includes.h | 5 | ||||
-rw-r--r-- | src/lib/ndpi_main.c | 6 |
2 files changed, 3 insertions, 8 deletions
diff --git a/src/include/ndpi_includes.h b/src/include/ndpi_includes.h index ae6230923..3e864d300 100644 --- a/src/include/ndpi_includes.h +++ b/src/include/ndpi_includes.h @@ -44,11 +44,6 @@ #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> -#ifndef __APPLE__ -#include <netinet/ip.h> -#include <netinet/tcp.h> -#include <netinet/udp.h> -#endif #if !defined __APPLE__ && !defined __FreeBSD__ && !defined __NetBSD__ && !defined __OpenBSD__ #include <endian.h> diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c index b64b928a1..b285bbb22 100644 --- a/src/lib/ndpi_main.c +++ b/src/lib/ndpi_main.c @@ -6521,8 +6521,8 @@ static u_int8_t ndpi_detection_get_l4_internal(struct ndpi_detection_module_stru iph = (const struct ndpi_iphdr *) l3; - if(iph->version == IPVERSION && iph->ihl >= 5) { - NDPI_LOG_DBG2(ndpi_str, "ipv4 header\n"); + if((iph->version == 4 /* IPVERSION */) && (iph->ihl >= 5)) { + NDPI_LOG_DBG2(ndpi_str, "IPv4 header\n"); } else if(iph->version == 6 && l3_len >= sizeof(struct ndpi_ipv6hdr)) { NDPI_LOG_DBG2(ndpi_str, "ipv6 header\n"); @@ -6731,7 +6731,7 @@ static int ndpi_init_packet(struct ndpi_detection_module_struct *ndpi_str, if(packet->iph != NULL) decaps_iph = packet->iph; - if(decaps_iph && decaps_iph->version == IPVERSION && decaps_iph->ihl >= 5) { + if(decaps_iph && (decaps_iph->version == 4 /* IPVERSION */) && (decaps_iph->ihl >= 5)) { NDPI_LOG_DBG2(ndpi_str, "ipv4 header\n"); } else if(decaps_iph && decaps_iph->version == 6 && l3len >= sizeof(struct ndpi_ipv6hdr) && (ndpi_str->ip_version_limit & NDPI_DETECTION_ONLY_IPV4) == 0) { |