From: Wouter Wijngaards Date: Mon, 18 Aug 2014 14:42:26 +0000 (+0000) Subject: Fixup for dnstap. X-Git-Tag: release-1.5.0rc1~51 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aa9a1721ccdf5a6787b59bfa38684db8cdedc7d8;p=thirdparty%2Funbound.git Fixup for dnstap. git-svn-id: file:///svn/unbound/trunk@3209 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/Makefile.in b/Makefile.in index dec1a1d9a..7300b3e34 100644 --- a/Makefile.in +++ b/Makefile.in @@ -72,7 +72,7 @@ LINT=splint LINTFLAGS=+quiet -weak -warnposix -unrecog -Din_addr_t=uint32_t -Du_int=unsigned -Du_char=uint8_t -preproc -Drlimit=rlimit64 -D__gnuc_va_list=va_list -formatcode #-Dglob64=glob -Dglobfree64=globfree # compat with openssl linux edition. -LINTFLAGS+="-DBN_ULONG=unsigned long" -Dkrb5_int32=int "-Dkrb5_ui_4=unsigned int" -DPQ_64BIT=uint64_t -DRC4_INT=unsigned -fixedformalarray -D"ENGINE=unsigned" -D"RSA=unsigned" -D"DSA=unsigned" -D"EVP_PKEY=unsigned" -D"EVP_MD=unsigned" -D"SSL=unsigned" -D"SSL_CTX=unsigned" -D"X509=unsigned" -D"RC4_KEY=unsigned" -D"EVP_MD_CTX=unsigned" -D"ECDSA_SIG=DSA_SIG" +LINTFLAGS+="-DBN_ULONG=unsigned long" -Dkrb5_int32=int "-Dkrb5_ui_4=unsigned int" -DPQ_64BIT=uint64_t -DRC4_INT=unsigned -fixedformalarray -D"ENGINE=unsigned" -D"RSA=unsigned" -D"DSA=unsigned" -D"EVP_PKEY=unsigned" -D"EVP_MD=unsigned" -D"SSL=unsigned" -D"SSL_CTX=unsigned" -D"X509=unsigned" -D"RC4_KEY=unsigned" -D"EVP_MD_CTX=unsigned" -D"ECDSA_SIG=DSA_SIG" -Dfstrm_res=int # compat with NetBSD LINTFLAGS+=@NETBSD_LINTFLAGS@ # compat with OpenBSD @@ -432,7 +432,7 @@ realclean: clean $(LINT) $(LINTFLAGS) -I. -I$(srcdir) $< touch $@ -util/configparser.lint util/configlexer.lint pythonmod/pythonmod.lint libunbound/python/libunbound_wrap.lint: +util/configparser.lint util/configlexer.lint pythonmod/pythonmod.lint libunbound/python/libunbound_wrap.lint dnstap/dnstap.pb-c.lint: # skip lint for generated code touch $@ diff --git a/daemon/daemon.c b/daemon/daemon.c index f05cdb198..f693a0285 100644 --- a/daemon/daemon.c +++ b/daemon/daemon.c @@ -404,7 +404,7 @@ daemon_create_workers(struct daemon* daemon) if(daemon->cfg->dnstap) { #ifdef USE_DNSTAP daemon->dtenv = dt_create(daemon->cfg->dnstap_socket_path, - daemon->num); + (unsigned int)daemon->num); if (!daemon->dtenv) fatal_exit("dt_create failed"); dt_apply_cfg(daemon->dtenv, daemon->cfg); diff --git a/dnstap/dnstap.c b/dnstap/dnstap.c index 413bd3745..d999ffd50 100644 --- a/dnstap/dnstap.c +++ b/dnstap/dnstap.c @@ -173,7 +173,7 @@ dt_apply_identity(struct dt_env *env, struct config_file *cfg) } if (env->identity == NULL) fatal_exit("dt_apply_identity: strdup() failed"); - env->len_identity = strlen(env->identity); + env->len_identity = (unsigned int)strlen(env->identity); verbose(VERB_OPS, "dnstap identity field set to \"%s\"", env->identity); } @@ -190,7 +190,7 @@ dt_apply_version(struct dt_env *env, struct config_file *cfg) env->version = strdup(cfg->dnstap_version); if (env->version == NULL) fatal_exit("dt_apply_version: strdup() failed"); - env->len_version = strlen(env->version); + env->len_version = (unsigned int)strlen(env->version); verbose(VERB_OPS, "dnstap version field set to \"%s\"", env->version); } @@ -203,32 +203,32 @@ dt_apply_cfg(struct dt_env *env, struct config_file *cfg) dt_apply_identity(env, cfg); dt_apply_version(env, cfg); - if ((env->log_resolver_query_messages = + if ((env->log_resolver_query_messages = (unsigned int) cfg->dnstap_log_resolver_query_messages)) { verbose(VERB_OPS, "dnstap Message/RESOLVER_QUERY enabled"); } - if ((env->log_resolver_response_messages = + if ((env->log_resolver_response_messages = (unsigned int) cfg->dnstap_log_resolver_response_messages)) { verbose(VERB_OPS, "dnstap Message/RESOLVER_RESPONSE enabled"); } - if ((env->log_client_query_messages = + if ((env->log_client_query_messages = (unsigned int) cfg->dnstap_log_client_query_messages)) { verbose(VERB_OPS, "dnstap Message/CLIENT_QUERY enabled"); } - if ((env->log_client_response_messages = + if ((env->log_client_response_messages = (unsigned int) cfg->dnstap_log_client_response_messages)) { verbose(VERB_OPS, "dnstap Message/CLIENT_RESPONSE enabled"); } - if ((env->log_forwarder_query_messages = + if ((env->log_forwarder_query_messages = (unsigned int) cfg->dnstap_log_forwarder_query_messages)) { verbose(VERB_OPS, "dnstap Message/FORWARDER_QUERY enabled"); } - if ((env->log_forwarder_response_messages = + if ((env->log_forwarder_response_messages = (unsigned int) cfg->dnstap_log_forwarder_response_messages)) { verbose(VERB_OPS, "dnstap Message/FORWARDER_RESPONSE enabled"); @@ -261,8 +261,10 @@ dt_fill_timeval(const struct timeval *tv, uint64_t *time_sec, protobuf_c_boolean *has_time_sec, uint32_t *time_nsec, protobuf_c_boolean *has_time_nsec) { +#ifndef S_SPLINT_S *time_sec = tv->tv_sec; *time_nsec = tv->tv_usec * 1000; +#endif *has_time_sec = 1; *has_time_nsec = 1; } diff --git a/dnstap/dnstap_config.h b/dnstap/dnstap_config.h deleted file mode 100644 index 58fb7e695..000000000 --- a/dnstap/dnstap_config.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef UNBOUND_DNSTAP_CONFIG_H -#define UNBOUND_DNSTAP_CONFIG_H - -/* - * Process this file (dnstap_config.h.in) with AC_CONFIG_FILES to generate - * dnstap_config.h. - * - * This file exists so that USE_DNSTAP can be used without including config.h. - */ - -#if 1 /* ENABLE_DNSTAP */ -# ifndef USE_DNSTAP -# define USE_DNSTAP 1 -# endif -#endif - -#endif /* UNBOUND_DNSTAP_CONFIG_H */ diff --git a/testdata/01-doc.tpkg b/testdata/01-doc.tpkg index af82a3e41..6502bdc14 100644 Binary files a/testdata/01-doc.tpkg and b/testdata/01-doc.tpkg differ