aboutsummaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/ndpi_analyze.c56
-rw-r--r--src/lib/ndpi_main.c45
-rw-r--r--src/lib/ndpi_serializer.c4
-rw-r--r--src/lib/protocols/csgo.c6
-rw-r--r--src/lib/protocols/ppstream.c27
-rw-r--r--src/lib/protocols/quic.c2
-rw-r--r--src/lib/protocols/rtp.c3
-rw-r--r--src/lib/protocols/stun.c4
-rw-r--r--src/lib/protocols/tcp_udp.c6
-rw-r--r--src/lib/protocols/teamspeak.c4
-rw-r--r--src/lib/protocols/xbox.c6
-rw-r--r--src/lib/protocols/zattoo.c11
-rw-r--r--src/lib/third_party/src/gcrypt/aesni.c9
-rw-r--r--src/lib/third_party/src/hll/hll.c4
14 files changed, 106 insertions, 81 deletions
diff --git a/src/lib/ndpi_analyze.c b/src/lib/ndpi_analyze.c
index 8968cd59d..5eb2c1bea 100644
--- a/src/lib/ndpi_analyze.c
+++ b/src/lib/ndpi_analyze.c
@@ -135,7 +135,7 @@ float ndpi_data_average(struct ndpi_analyze_struct *s) {
/* ********************************************************************************* */
u_int32_t ndpi_data_last(struct ndpi_analyze_struct *s) {
- if((!s) || (s->num_data_entries == 0) || (s->sum_total == 0))
+ if((!s) || (s->num_data_entries == 0) || (s->num_values_array_len == 0))
return(0);
if(s->next_value_insert_index == 0)
@@ -1586,3 +1586,57 @@ u_int ndpi_find_outliers(u_int32_t *values, bool *outliers, u_int32_t num_values
return(ret);
}
+/* ************************************************************/
+
+/* ********************************************************** */
+/* http://home.thep.lu.se/~bjorn/crc/crc32_fast.c */
+/* ********************************************************** */
+
+static uint32_t crc32_for_byte(uint32_t r) {
+ int j;
+
+ for(j = 0; j < 8; ++j)
+ r = ((r & 1) ? 0 : (uint32_t)0xEDB88320L) ^ r >> 1;
+ return r ^ (uint32_t)0xFF000000L;
+}
+
+/* Any unsigned integer type with at least 32 bits may be used as
+ * accumulator type for fast crc32-calulation, but unsigned long is
+ * probably the optimal choice for most systems. */
+typedef unsigned long accum_t;
+
+static void init_tables(uint32_t* table, uint32_t* wtable) {
+ size_t i, j, k, w;
+
+ for(i = 0; i < 0x100; ++i)
+ table[i] = crc32_for_byte(i);
+ for(k = 0; k < sizeof(accum_t); ++k)
+ for(i = 0; i < 0x100; ++i) {
+ for(j = w = 0; j < sizeof(accum_t); ++j)
+ w = table[(uint8_t)(j == k? w ^ i: w)] ^ w >> 8;
+ wtable[(k << 8) + i] = w ^ (k? wtable[0]: 0);
+ }
+}
+
+static void __crc32(const void* data, size_t n_bytes, uint32_t* crc) {
+ static uint32_t table[0x100], wtable[0x100*sizeof(accum_t)];
+ size_t n_accum = n_bytes/sizeof(accum_t);
+ size_t i, j;
+
+ if(!*table)
+ init_tables(table, wtable);
+ for(i = 0; i < n_accum; ++i) {
+ accum_t a = *crc ^ ((accum_t*)data)[i];
+ for(j = *crc = 0; j < sizeof(accum_t); ++j)
+ *crc ^= wtable[(j << 8) + (uint8_t)(a >> 8*j)];
+ }
+ for(i = n_accum*sizeof(accum_t); i < n_bytes; ++i)
+ *crc = table[(uint8_t)*crc ^ ((uint8_t*)data)[i]] ^ *crc >> 8;
+}
+
+u_int32_t ndpi_crc32(const void* data, size_t n_bytes) {
+ u_int32_t crc = 0;
+
+ __crc32(data, n_bytes, &crc);
+ return crc;
+}
diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c
index 5c79ae515..6d8da0b78 100644
--- a/src/lib/ndpi_main.c
+++ b/src/lib/ndpi_main.c
@@ -339,6 +339,8 @@ u_int32_t ndpi_detection_get_sizeof_ndpi_flow_udp_struct(void) {
/* *********************************************************************************** */
char *ndpi_get_proto_by_id(struct ndpi_detection_module_struct *ndpi_str, u_int id) {
+ if(!ndpi_str)
+ return NULL;
return((id >= ndpi_str->ndpi_num_supported_protocols) ? NULL : ndpi_str->proto_defaults[id].protoName);
}
@@ -346,10 +348,16 @@ char *ndpi_get_proto_by_id(struct ndpi_detection_module_struct *ndpi_str, u_int
u_int16_t ndpi_get_proto_by_name(struct ndpi_detection_module_struct *ndpi_str, const char *name) {
u_int16_t i, num = ndpi_get_num_supported_protocols(ndpi_str);
+ char *p;
+
+ if(!ndpi_str || !name)
+ return(NDPI_PROTOCOL_UNKNOWN);
- for(i = 0; i < num; i++)
- if(strcasecmp(ndpi_get_proto_by_id(ndpi_str, i), name) == 0)
+ for(i = 0; i < num; i++) {
+ p = ndpi_get_proto_by_id(ndpi_str, i);
+ if(p && strcasecmp(p, name) == 0)
return(i);
+ }
return(NDPI_PROTOCOL_UNKNOWN);
}
@@ -402,7 +410,7 @@ void ndpi_set_proto_breed(struct ndpi_detection_module_struct *ndpi_str,
u_int16_t protoId, ndpi_protocol_breed_t breed) {
if(!ndpi_is_valid_protoId(protoId))
return;
- else
+ else if(ndpi_str)
ndpi_str->proto_defaults[protoId].protoBreed = breed;
}
@@ -412,7 +420,7 @@ void ndpi_set_proto_category(struct ndpi_detection_module_struct *ndpi_str, u_in
ndpi_protocol_category_t protoCategory) {
if(!ndpi_is_valid_protoId(protoId))
return;
- else
+ else if(ndpi_str)
ndpi_str->proto_defaults[protoId].protoCategory = protoCategory;
}
@@ -2167,6 +2175,8 @@ int ac_domain_match_handler(AC_MATCH_t *m, AC_TEXT_t *txt, AC_REP_t *match) {
/* ******************************************************************** */
u_int16_t ndpi_patricia_get_maxbits(ndpi_patricia_tree_t *tree) {
+ if(!tree)
+ return 0;
return(tree->maxbits);
}
@@ -3261,7 +3271,7 @@ int ndpi_get_custom_category_match(struct ndpi_detection_module_struct *ndpi_str
ndpi_patricia_node_t *node;
/* Make sure all in network byte order otherwise compares wont work */
- ndpi_fill_prefix_v4(&prefix, &pin, 32, ((ndpi_patricia_tree_t *) ndpi_str->protocols_ptree)->maxbits);
+ ndpi_fill_prefix_v4(&prefix, &pin, 32, ((ndpi_patricia_tree_t *) ndpi_str->custom_categories.ipAddresses)->maxbits);
node = ndpi_patricia_search_best(ndpi_str->custom_categories.ipAddresses, &prefix);
if(node) {
@@ -3560,7 +3570,7 @@ u_int16_t ndpi_guess_protocol_id(struct ndpi_detection_module_struct *ndpi_str,
/* ******************************************************************** */
u_int ndpi_get_num_supported_protocols(struct ndpi_detection_module_struct *ndpi_str) {
- return(ndpi_str->ndpi_num_supported_protocols);
+ return(ndpi_str ? ndpi_str->ndpi_num_supported_protocols : 0);
}
/* ******************************************************************** */
@@ -6354,14 +6364,14 @@ int ndpi_fill_ip_protocol_category(struct ndpi_detection_module_struct *ndpi_str
else {
/* Make sure all in network byte order otherwise compares wont work */
ndpi_fill_prefix_v4(&prefix, (struct in_addr *) &saddr, 32,
- ((ndpi_patricia_tree_t *) ndpi_str->protocols_ptree)->maxbits);
+ ((ndpi_patricia_tree_t *) ndpi_str->custom_categories.ipAddresses)->maxbits);
node = ndpi_patricia_search_best(ndpi_str->custom_categories.ipAddresses, &prefix);
}
if(!node) {
if(daddr != 0) {
ndpi_fill_prefix_v4(&prefix, (struct in_addr *) &daddr, 32,
- ((ndpi_patricia_tree_t *) ndpi_str->protocols_ptree)->maxbits);
+ ((ndpi_patricia_tree_t *) ndpi_str->custom_categories.ipAddresses)->maxbits);
node = ndpi_patricia_search_best(ndpi_str->custom_categories.ipAddresses, &prefix);
}
}
@@ -7843,7 +7853,7 @@ int ndpi_is_custom_category(ndpi_protocol_category_t category) {
void ndpi_category_set_name(struct ndpi_detection_module_struct *ndpi_str,
ndpi_protocol_category_t category,
char *name) {
- if(!name)
+ if(!ndpi_str || !name)
return;
switch(category) {
@@ -8853,10 +8863,15 @@ void ndpi_ptree_destroy(ndpi_ptree_t *tree) {
int ndpi_ptree_insert(ndpi_ptree_t *tree, const ndpi_ip_addr_t *addr,
u_int8_t bits, u_int64_t user_data) {
u_int8_t is_v6 = ndpi_is_ipv6(addr);
- ndpi_patricia_tree_t *ptree = is_v6 ? tree->v6 : tree->v4;
+ ndpi_patricia_tree_t *ptree;
ndpi_prefix_t prefix;
ndpi_patricia_node_t *node;
+ if(!tree)
+ return(-4);
+
+ ptree = is_v6 ? tree->v6 : tree->v4;
+
if(bits > ptree->maxbits)
return(-1);
@@ -8887,10 +8902,16 @@ int ndpi_ptree_insert(ndpi_ptree_t *tree, const ndpi_ip_addr_t *addr,
int ndpi_ptree_match_addr(ndpi_ptree_t *tree,
const ndpi_ip_addr_t *addr, u_int64_t *user_data) {
u_int8_t is_v6 = ndpi_is_ipv6(addr);
- ndpi_patricia_tree_t *ptree = is_v6 ? tree->v6 : tree->v4;
+ ndpi_patricia_tree_t *ptree;
ndpi_prefix_t prefix;
ndpi_patricia_node_t *node;
- int bits = ptree->maxbits;
+ int bits;
+
+ if(!tree)
+ return(-2);
+
+ ptree = is_v6 ? tree->v6 : tree->v4;
+ bits = ptree->maxbits;
if(is_v6)
ndpi_fill_prefix_v6(&prefix, (const struct in6_addr *) &addr->ipv6, bits, ptree->maxbits);
diff --git a/src/lib/ndpi_serializer.c b/src/lib/ndpi_serializer.c
index de7b2fd7c..17231a83b 100644
--- a/src/lib/ndpi_serializer.c
+++ b/src/lib/ndpi_serializer.c
@@ -199,7 +199,7 @@ void ndpi_serializer_skip_header(ndpi_serializer *_serializer) {
static int ndpi_init_serializer_buffer(ndpi_private_serializer_buffer *buffer, u_int32_t buffer_size) {
buffer->initial_size = buffer->size = buffer_size;
- buffer->data = (u_int8_t *) calloc(buffer->size, sizeof(u_int8_t));
+ buffer->data = (u_int8_t *)ndpi_calloc(buffer->size, sizeof(u_int8_t));
if(buffer->data == NULL)
return(-1);
@@ -2246,6 +2246,8 @@ int ndpi_serialize_end_of_list(ndpi_serializer *_serializer) {
serializer->status.flags &= ~NDPI_SERIALIZER_STATUS_LIST;
} else {
+ if(serializer->status.buffer.size_used == serializer->buffer.size)
+ return(-1);
serializer->buffer.data[serializer->status.buffer.size_used++] = ndpi_serialization_end_of_list;
}
diff --git a/src/lib/protocols/csgo.c b/src/lib/protocols/csgo.c
index a7d0cd130..fc298e781 100644
--- a/src/lib/protocols/csgo.c
+++ b/src/lib/protocols/csgo.c
@@ -62,12 +62,6 @@ static void ndpi_search_csgo(struct ndpi_detection_module_struct* ndpi_struct, s
return;
}
- if(packet->payload_packet_len >= 36 && w == 0x56533031ul) {
- NDPI_LOG_INFO( ndpi_struct, "found csgo udp\n");
- ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_CSGO, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
- return;
- }
-
if(packet->payload_packet_len >= 36 && w == 0x01007364) {
uint32_t w2 = htonl(get_u_int32_t(packet->payload, 4));
if(w2 == 0x70696e67) {
diff --git a/src/lib/protocols/ppstream.c b/src/lib/protocols/ppstream.c
index 78dc25393..dad801ff4 100644
--- a/src/lib/protocols/ppstream.c
+++ b/src/lib/protocols/ppstream.c
@@ -68,9 +68,6 @@ static void ndpi_search_ppstream(struct ndpi_detection_module_struct
packet->payload[13] == 0x00 &&
packet->payload[14] == 0x00) {
- /* increase count pkt ppstream over udp */
- flow->l4.udp.ppstream_stage++;
-
ndpi_int_ppstream_add_connection(ndpi_struct, flow);
return;
}
@@ -92,9 +89,6 @@ static void ndpi_search_ppstream(struct ndpi_detection_module_struct
packet->payload[19] == 0x00 &&
packet->payload[20] == 0x00) {
- /* increase count pkt ppstream over udp */
- flow->l4.udp.ppstream_stage++;
-
ndpi_int_ppstream_add_connection(ndpi_struct, flow);
return;
}
@@ -105,9 +99,6 @@ static void ndpi_search_ppstream(struct ndpi_detection_module_struct
packet->payload[19] == 0xff &&
packet->payload[20] == 0xff) {
- /* increase count pkt ppstream over udp */
- flow->l4.udp.ppstream_stage++;
-
ndpi_int_ppstream_add_connection(ndpi_struct, flow);
return;
}
@@ -128,9 +119,6 @@ static void ndpi_search_ppstream(struct ndpi_detection_module_struct
packet->payload[19] == 0x00 &&
packet->payload[20] == 0x00) {
- /* increase count pkt ppstream over udp */
- flow->l4.udp.ppstream_stage++;
-
ndpi_int_ppstream_add_connection(ndpi_struct, flow);
return;
}
@@ -147,9 +135,6 @@ static void ndpi_search_ppstream(struct ndpi_detection_module_struct
packet->payload[100] == 0x61 &&
packet->payload[101] == 0x6d) {
- /* increase count pkt ppstream over udp */
- flow->l4.udp.ppstream_stage++;
-
ndpi_int_ppstream_add_connection(ndpi_struct, flow);
return;
}
@@ -166,9 +151,6 @@ static void ndpi_search_ppstream(struct ndpi_detection_module_struct
packet->payload[19] == 0x00 &&
packet->payload[20] == 0x00 )) {
- /* increase count pkt ppstream over udp */
- flow->l4.udp.ppstream_stage++;
-
ndpi_int_ppstream_add_connection(ndpi_struct, flow);
return;
}
@@ -187,9 +169,6 @@ static void ndpi_search_ppstream(struct ndpi_detection_module_struct
packet->payload[19] == 0x00 &&
packet->payload[20] == 0x00 )) {
- /* increase count pkt ppstream over udp */
- flow->l4.udp.ppstream_stage++;
-
ndpi_int_ppstream_add_connection(ndpi_struct, flow);
return;
}
@@ -200,9 +179,6 @@ static void ndpi_search_ppstream(struct ndpi_detection_module_struct
if(packet->payload[1] == 0x80 || packet->payload[1] == 0x84 ) {
if(packet->payload[3] == packet->payload[4]) {
- /* increase count pkt ppstream over udp */
- flow->l4.udp.ppstream_stage++;
-
ndpi_int_ppstream_add_connection(ndpi_struct, flow);
return;
}
@@ -211,9 +187,6 @@ static void ndpi_search_ppstream(struct ndpi_detection_module_struct
else if(packet->payload[1] == 0x53 && packet->payload[3] == 0x00 &&
(packet->payload[0] == 0x08 || packet->payload[0] == 0x0c)) {
- /* increase count pkt ppstream over udp */
- flow->l4.udp.ppstream_stage++;
-
ndpi_int_ppstream_add_connection(ndpi_struct, flow);
return;
}
diff --git a/src/lib/protocols/quic.c b/src/lib/protocols/quic.c
index ae7a97465..c095550ab 100644
--- a/src/lib/protocols/quic.c
+++ b/src/lib/protocols/quic.c
@@ -246,6 +246,7 @@ static uint16_t gquic_get_u16(const uint8_t *buf, uint32_t version)
}
+#ifdef NDPI_ENABLE_DEBUG_MESSAGES
static char *__gcry_err(gpg_error_t err, char *buf, size_t buflen)
{
gpg_strerror_r(err, buf, buflen);
@@ -255,6 +256,7 @@ static char *__gcry_err(gpg_error_t err, char *buf, size_t buflen)
buf[buflen - 1] = '\0';
return buf;
}
+#endif
static uint64_t pntoh64(const void *p)
{
diff --git a/src/lib/protocols/rtp.c b/src/lib/protocols/rtp.c
index 779c6b9f8..b90941bbb 100644
--- a/src/lib/protocols/rtp.c
+++ b/src/lib/protocols/rtp.c
@@ -54,7 +54,6 @@ static u_int8_t isValidMSRTPType(u_int8_t payloadType, enum ndpi_rtp_stream_type
case 118: /* Comfort Noise Wideband */
*s_type = rtp_audio;
return(1 /* RTP */);
- break;
case 34: /* H.263 [MS-H26XPF] */
case 121: /* RT Video */
@@ -63,7 +62,6 @@ static u_int8_t isValidMSRTPType(u_int8_t payloadType, enum ndpi_rtp_stream_type
case 127: /* x-data */
*s_type = rtp_video;
return(1 /* RTP */);
- break;
case 200: /* RTCP PACKET SENDER */
case 201: /* RTCP PACKET RECEIVER */
@@ -71,7 +69,6 @@ static u_int8_t isValidMSRTPType(u_int8_t payloadType, enum ndpi_rtp_stream_type
case 203: /* RTCP Bye */
*s_type = rtp_unknown;
return(2 /* RTCP */);
- break;
default:
return(0);
diff --git a/src/lib/protocols/stun.c b/src/lib/protocols/stun.c
index 80e577ab1..22b4c7097 100644
--- a/src/lib/protocols/stun.c
+++ b/src/lib/protocols/stun.c
@@ -326,7 +326,6 @@ static ndpi_int_stun_t ndpi_int_check_stun(struct ndpi_detection_module_struct *
case 0x0103:
*app_proto = NDPI_PROTOCOL_ZOOM;
return(NDPI_IS_STUN);
- break;
case 0x4000:
case 0x4001:
@@ -334,7 +333,6 @@ static ndpi_int_stun_t ndpi_int_check_stun(struct ndpi_detection_module_struct *
/* These are the only messages apparently whatsapp voice can use */
*app_proto = NDPI_PROTOCOL_WHATSAPP_CALL;
return(NDPI_IS_STUN);
- break;
case 0x0014: /* Realm */
{
@@ -406,7 +404,6 @@ static ndpi_int_stun_t ndpi_int_check_stun(struct ndpi_detection_module_struct *
*app_proto = NDPI_PROTOCOL_SKYPE_TEAMS_CALL;
return(NDPI_IS_STUN);
- break;
case 0x8070: /* Implementation Version */
if(len == 4 && ((offset+7) < payload_length)
@@ -424,7 +421,6 @@ static ndpi_int_stun_t ndpi_int_check_stun(struct ndpi_detection_module_struct *
case 0xFF03:
*app_proto = NDPI_PROTOCOL_HANGOUT_DUO;
return(NDPI_IS_STUN);
- break;
default:
#ifdef DEBUG_STUN
diff --git a/src/lib/protocols/tcp_udp.c b/src/lib/protocols/tcp_udp.c
index 9aa0349f0..ec49e63ba 100644
--- a/src/lib/protocols/tcp_udp.c
+++ b/src/lib/protocols/tcp_udp.c
@@ -53,11 +53,13 @@ void ndpi_search_tcp_or_udp(struct ndpi_detection_module_struct *ndpi_struct, st
{
u_int16_t sport, dport;
u_int proto;
- struct ndpi_packet_struct *packet = &ndpi_struct->packet;
+ struct ndpi_packet_struct *packet;
- if(flow->host_server_name[0] != '\0')
+ if(!ndpi_struct || !flow || flow->host_server_name[0] != '\0')
return;
+ packet = &ndpi_struct->packet;
+
if(packet->udp) sport = ntohs(packet->udp->source), dport = ntohs(packet->udp->dest);
else if(packet->tcp) sport = ntohs(packet->tcp->source), dport = ntohs(packet->tcp->dest);
else sport = dport = 0;
diff --git a/src/lib/protocols/teamspeak.c b/src/lib/protocols/teamspeak.c
index f38962b31..9184e16e5 100644
--- a/src/lib/protocols/teamspeak.c
+++ b/src/lib/protocols/teamspeak.c
@@ -90,10 +90,6 @@ ts3_license_weblist:
ndpi_int_teamspeak_add_connection(ndpi_struct, flow);
return;
}
- if (flow->packet_counter >= 3)
- {
- NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
- }
}
void init_teamspeak_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id)
diff --git a/src/lib/protocols/xbox.c b/src/lib/protocols/xbox.c
index f47018a06..d63d8d787 100644
--- a/src/lib/protocols/xbox.c
+++ b/src/lib/protocols/xbox.c
@@ -91,13 +91,7 @@ static void ndpi_search_xbox(struct ndpi_detection_module_struct *ndpi_struct, s
return;
}
#endif
-
- /* exclude here all non matched udp traffic, exclude here tcp only if http has been excluded, because xbox could use http */
- if(NDPI_COMPARE_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_HTTP) != 0) {
- NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
- }
}
- /* to not exclude tcp traffic here, done by http code... */
}
diff --git a/src/lib/protocols/zattoo.c b/src/lib/protocols/zattoo.c
index 04e5431a5..cf67a82c5 100644
--- a/src/lib/protocols/zattoo.c
+++ b/src/lib/protocols/zattoo.c
@@ -170,17 +170,6 @@ static void ndpi_search_zattoo(struct ndpi_detection_module_struct *ndpi_struct,
ZATTOO_DETECTED;
return;
- } else if(flow->zattoo_stage == 5 + packet->packet_direction && (packet->payload_packet_len == 125)) {
-
- NDPI_LOG_INFO(ndpi_struct, "found zattoo\n");
- ZATTOO_DETECTED;
- return;
-
- } else if(flow->zattoo_stage == 6 - packet->packet_direction && packet->payload_packet_len == 1412) {
-
- NDPI_LOG_INFO(ndpi_struct, "found zattoo\n");
- ZATTOO_DETECTED;
- return;
}
NDPI_LOG_DBG2(ndpi_struct,
diff --git a/src/lib/third_party/src/gcrypt/aesni.c b/src/lib/third_party/src/gcrypt/aesni.c
index b47fb6ba6..d1379de6f 100644
--- a/src/lib/third_party/src/gcrypt/aesni.c
+++ b/src/lib/third_party/src/gcrypt/aesni.c
@@ -49,6 +49,10 @@
static u_int8_t cached_has_aesni = 0, has_aesni_checked = 0;
#endif
+#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
+int force_no_aesni = 0;
+#endif
+
/*
* AES-NI support detection routine
*/
@@ -60,6 +64,11 @@ int mbedtls_aesni_has_support( unsigned int what )
# endif
#endif
+#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
+ if(force_no_aesni == 1)
+ return 0;
+#endif
+
#if defined(linux) || defined(__linux__)
if(has_aesni_checked == 0) {
/*
diff --git a/src/lib/third_party/src/hll/hll.c b/src/lib/third_party/src/hll/hll.c
index b0e0a1343..344971b61 100644
--- a/src/lib/third_party/src/hll/hll.c
+++ b/src/lib/third_party/src/hll/hll.c
@@ -30,10 +30,6 @@
#include "../include/MurmurHash3.h"
#include "../include/hll.h"
-u_int32_t _hll_hash(const struct ndpi_hll *hll) {
- return MurmurHash3_x86_32(hll->registers, (u_int32_t)hll->size, 0);
-}
-
/* Count the number of leading zero's */
static __inline u_int8_t _hll_rank(u_int32_t hash, u_int8_t bits) {
u_int8_t i;