diff options
author | MrTiz9 <tiziano.marra@pm.me> | 2020-02-01 13:47:42 +0100 |
---|---|---|
committer | MrTiz9 <tiziano.marra@pm.me> | 2020-02-01 13:47:42 +0100 |
commit | b3138d5e3e44089bc22bdc58ea3c422ce67409f2 (patch) | |
tree | 0816a186be4ba6f29aca3c9566eba0eeef493ba4 | |
parent | 5c8c2d843afc38f6246c678ea41e81b1a88bcf17 (diff) | |
parent | 39b1ad3087471cc6f9e11ea52b903060e0189e72 (diff) |
Merge branch 'dev' of https://github.com/ntop/nDPI into dev-unstable
-rw-r--r-- | configure.seed | 5 | ||||
-rw-r--r-- | example/Makefile.in | 2 | ||||
-rw-r--r-- | src/lib/ndpi_community_id.c | 4 |
3 files changed, 8 insertions, 3 deletions
diff --git a/configure.seed b/configure.seed index 68997975e..6cf9046d6 100644 --- a/configure.seed +++ b/configure.seed @@ -41,6 +41,7 @@ AC_DEFINE_UNQUOTED(NDPI_GIT_DATE, "${GIT_DATE}", [Last GIT change]) AC_CHECK_HEADERS([netinet/in.h stdint.h stdlib.h string.h unistd.h]) +ADDITIONAL_LIBS= PCAP_HOME=$HOME/PF_RING/userland DPDK_TARGET= @@ -161,6 +162,9 @@ AM_CONDITIONAL([HAS_FUZZLDFLAGS], [test "x$has_sanitizefuzzer" = "xyes"]) AC_CHECK_LIB(pthread, pthread_setaffinity_np, AC_DEFINE_UNQUOTED(HAVE_PTHREAD_SETAFFINITY_NP, 1, [libc has pthread_setaffinity_np])) AC_CHECK_LIB(pcre, pcre_compile, AC_DEFINE_UNQUOTED(HAVE_PCRE, 1, [libpcre(-dev) is present])) +if test "x$ac_cv_lib_pcre_pcre_compile" = xyes; then : +ADDITIONAL_LIBS=-lpcre +fi AC_CONFIG_FILES([Makefile example/Makefile example/Makefile.dpdk tests/Makefile libndpi.pc src/include/ndpi_define.h src/lib/Makefile python/Makefile fuzz/Makefile]) AC_CONFIG_HEADERS(src/include/ndpi_config.h) @@ -173,6 +177,7 @@ AC_SUBST(SVN_DATE) AC_SUBST(JSON_C_LIB) AC_SUBST(PCAP_INC) AC_SUBST(PCAP_LIB) +AC_SUBST(ADDITIONAL_LIBS) AC_SUBST(DL_LIB) AC_SUBST(DPDK_TARGET) AC_SUBST(HAVE_PTHREAD_SETAFFINITY_NP) diff --git a/example/Makefile.in b/example/Makefile.in index cc47b3047..ec9c712ae 100644 --- a/example/Makefile.in +++ b/example/Makefile.in @@ -3,7 +3,7 @@ CXX=@CXX@ SRCHOME=../src CFLAGS=-g -I$(SRCHOME)/include @CFLAGS@ LIBNDPI=$(SRCHOME)/lib/libndpi.a -LDFLAGS=$(LIBNDPI) @PCAP_LIB@ -lpthread -lm @LDFLAGS@ +LDFLAGS=$(LIBNDPI) @PCAP_LIB@ @ADDITIONAL_LIBS@ -lpthread -lm @LDFLAGS@ HEADERS=intrusion_detection.h reader_util.h $(SRCHOME)/include/ndpi_api.h \ $(SRCHOME)/include/ndpi_typedefs.h $(SRCHOME)/include/ndpi_protocol_ids.h OBJS=ndpiReader.o reader_util.o intrusion_detection.o diff --git a/src/lib/ndpi_community_id.c b/src/lib/ndpi_community_id.c index 7b55fc009..30519b59e 100644 --- a/src/lib/ndpi_community_id.c +++ b/src/lib/ndpi_community_id.c @@ -173,7 +173,7 @@ static int ndpi_community_id_peer_v6_is_less_than(struct ndpi_in6_addr *ip1, str /* **************************************************** */ static void ndpi_community_id_sha1_hash(const uint8_t *message, size_t len, u_char *hash /* 20-bytes */) { - SHA1_CTX ctx = { 0 }; + SHA1_CTX ctx; SHA1Init(&ctx); SHA1Update(&ctx, message, len); SHA1Final(hash, &ctx); @@ -217,7 +217,7 @@ static int ndpi_community_id_finalize_and_compute_hash(u_int8_t *comm_buf, u_int if (community_id == NULL) return -1; -#if 1 /* Debug Info */ +#if 0 /* Debug Info */ printf("Hex output: "); for(int i = 0; i < off; i++) printf("%.2x ", comm_buf[i]); |