From: Christopher Zimmermann Date: Wed, 3 Feb 2021 12:19:19 +0000 (+0100) Subject: Merge remote-tracking branch 'upstream/master' X-Git-Tag: release-1.21.0rc1~48^2~8^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1d23e0c9206d061e8f1d04c934d4a69a3e177769;p=thirdparty%2Funbound.git Merge remote-tracking branch 'upstream/master' --- 1d23e0c9206d061e8f1d04c934d4a69a3e177769 diff --cc config.h.in index 0b1f8053a,103ad9f00..77a8a87d7 --- a/config.h.in +++ b/config.h.in @@@ -371,9 -381,15 +381,18 @@@ /* Define to 1 if you have the header file. */ #undef HAVE_NETTLE_EDDSA_H +/* Define to 1 if you have the header file. */ +#undef HAVE_NET_PFVAR_H + + /* Define to 1 if you have the header file. */ + #undef HAVE_NET_IF_H + + /* Define this to use nghttp2 client. */ + #undef HAVE_NGHTTP2 + + /* Define to 1 if you have the header file. */ + #undef HAVE_NGHTTP2_NGHTTP2_H + /* Use libnss for crypto */ #undef HAVE_NSS diff --cc configure.ac index 09bdf7c57,2d88048f7..3fd070188 --- a/configure.ac +++ b/configure.ac @@@ -1756,38 -1809,30 +1809,36 @@@ case "$enable_ipset" i IPSET_OBJ="ipset.lo" AC_SUBST(IPSET_OBJ) - # mnl - AC_ARG_WITH(libmnl, AS_HELP_STRING([--with-libmnl=path],[specify explicit path for libmnl.]), - [ ],[ withval="yes" ]) - found_libmnl="no" - AC_MSG_CHECKING(for libmnl) - if test x_$withval = x_ -o x_$withval = x_yes; then - withval="/usr/local /opt/local /usr/lib /usr/pkg /usr/sfw /usr" - fi - for dir in $withval ; do - if test -f "$dir/include/libmnl/libmnl.h"; then - found_libmnl="yes" - dnl assume /usr is in default path. - if test "$dir" != "/usr"; then - CPPFLAGS="$CPPFLAGS -I$dir/include" - LDFLAGS="$LDFLAGS -L$dir/lib" - fi - AC_MSG_RESULT(found in $dir) - LIBS="$LIBS -lmnl" - break; - fi - done - if test x_$found_libmnl != x_yes; then - AC_MSG_ERROR([Could not find libmnl, libmnl.h]) - fi + # BSD's pf + AC_CHECK_HEADERS([net/pfvar.h], [], [ + # mnl - AC_ARG_WITH(libmnl, AC_HELP_STRING([--with-libmnl=path], - [specify explicit path for libmnl.]), ++ AC_ARG_WITH(libmnl, AS_HELP_STRING([--with-libmnl=path],[specify explicit path for libmnl.]), + [ ],[ withval="yes" ]) + found_libmnl="no" + AC_MSG_CHECKING(for libmnl) + if test x_$withval = x_ -o x_$withval = x_yes; then + withval="/usr/local /opt/local /usr/lib /usr/pkg /usr/sfw /usr" + fi + for dir in $withval ; do + if test -f "$dir/include/libmnl/libmnl.h"; then + found_libmnl="yes" + dnl assume /usr is in default path. + if test "$dir" != "/usr"; then + CPPFLAGS="$CPPFLAGS -I$dir/include" + LDFLAGS="$LDFLAGS -L$dir/lib" + fi + AC_MSG_RESULT(found in $dir) + LIBS="$LIBS -lmnl" + break; + fi + done - if test x_$found_libmnl != x_yes - then - AC_ERROR([Could not find libmnl, libmnl.h]) ++ if test x_$found_libmnl != x_yes; then ++ AC_MSG_ERROR([Could not find libmnl, libmnl.h]) + fi + ], [ + #include + #include + ]) ;; no|*) # nothing diff --cc ipset/ipset.c index 347512406,f6e2c4a9d..347512406 mode 100755,100644..100644 --- a/ipset/ipset.c +++ b/ipset/ipset.c diff --cc ipset/ipset.h index 66a4378b6,f60a8be8c..66a4378b6 mode 100755,100644..100644 --- a/ipset/ipset.h +++ b/ipset/ipset.h diff --cc iterator/iterator.c index af209f84d,99d020117..636367888 --- a/iterator/iterator.c +++ b/iterator/iterator.c @@@ -72,8 -72,10 +72,10 @@@ /* in msec */ int UNKNOWN_SERVER_NICENESS = 376; + static void target_count_increase_nx(struct iter_qstate* iq, int num); + int -iter_init(struct module_env* env, int id) +iter_setup(struct module_env* env, int id) { struct iter_env* iter_env = (struct iter_env*)calloc(1, sizeof(struct iter_env)); diff --cc libunbound/libunbound.c index e1abfe64a,c9e24ba8d..acab120c5 --- a/libunbound/libunbound.c +++ b/libunbound/libunbound.c @@@ -172,8 -185,8 +185,9 @@@ ub_ctx_create(void ub_randfree(ctx->seed_rnd); config_delete(ctx->env->cfg); modstack_desetup(&ctx->mods, ctx->env); + modstack_deinit(&ctx->mods, ctx->env); edns_known_options_delete(ctx->env); + edns_strings_delete(ctx->env->edns_strings); free(ctx->env); free(ctx); errno = e; @@@ -185,8 -198,8 +199,9 @@@ ub_randfree(ctx->seed_rnd); config_delete(ctx->env->cfg); modstack_desetup(&ctx->mods, ctx->env); + modstack_deinit(&ctx->mods, ctx->env); edns_known_options_delete(ctx->env); + edns_strings_delete(ctx->env->edns_strings); free(ctx->env); free(ctx); errno = e; diff --cc util/fptr_wlist.c index 35d8bfaed,a9e9d3a03..28629430e --- a/util/fptr_wlist.c +++ b/util/fptr_wlist.c @@@ -382,72 -390,58 +390,78 @@@ fptr_whitelist_modenv_detect_cycle(int return 0; } -int +int fptr_whitelist_mod_init(int (*fptr)(struct module_env* env, int id)) { - if(fptr == &iter_init) return 1; - else if(fptr == &val_init) return 1; - else if(fptr == &dns64_init) return 1; - else if(fptr == &respip_init) return 1; + if(fptr == &module_dummy_init) return 1; +#ifdef USE_IPSET + else if(fptr == &ipset_init) return 1; +#endif + return 0; +} + +int +fptr_whitelist_mod_deinit(int (*fptr)(struct module_env* env, int id)) +{ + if(fptr == &module_dummy_init) return 1; +#ifdef USE_IPSET + else if(fptr == &ipset_deinit) return 1; +#endif + return 0; +} + +int +fptr_whitelist_mod_setup(int (*fptr)(struct module_env* env, int id)) +{ + if(fptr == &iter_setup) return 1; + else if(fptr == &val_setup) return 1; + else if(fptr == &dns64_setup) return 1; + else if(fptr == &respip_setup) return 1; #ifdef WITH_PYTHONMODULE - else if(fptr == &pythonmod_init) return 1; + else if(fptr == &pythonmod_setup) return 1; #endif + #ifdef WITH_DYNLIBMODULE + else if(fptr == &dynlibmod_init) return 1; + #endif #ifdef USE_CACHEDB - else if(fptr == &cachedb_init) return 1; + else if(fptr == &cachedb_setup) return 1; #endif #ifdef USE_IPSECMOD - else if(fptr == &ipsecmod_init) return 1; + else if(fptr == &ipsecmod_setup) return 1; #endif #ifdef CLIENT_SUBNET - else if(fptr == &subnetmod_init) return 1; + else if(fptr == &subnetmod_setup) return 1; #endif #ifdef USE_IPSET - else if(fptr == &ipset_init) return 1; + else if(fptr == &ipset_setup) return 1; #endif return 0; } int -fptr_whitelist_mod_deinit(void (*fptr)(struct module_env* env, int id)) +fptr_whitelist_mod_desetup(void (*fptr)(struct module_env* env, int id)) { - if(fptr == &iter_deinit) return 1; - else if(fptr == &val_deinit) return 1; - else if(fptr == &dns64_deinit) return 1; - else if(fptr == &respip_deinit) return 1; + if(fptr == &iter_desetup) return 1; + else if(fptr == &val_desetup) return 1; + else if(fptr == &dns64_desetup) return 1; + else if(fptr == &respip_desetup) return 1; #ifdef WITH_PYTHONMODULE - else if(fptr == &pythonmod_deinit) return 1; + else if(fptr == &pythonmod_desetup) return 1; #endif + #ifdef WITH_DYNLIBMODULE + else if(fptr == &dynlibmod_deinit) return 1; + #endif #ifdef USE_CACHEDB - else if(fptr == &cachedb_deinit) return 1; + else if(fptr == &cachedb_desetup) return 1; #endif #ifdef USE_IPSECMOD - else if(fptr == &ipsecmod_deinit) return 1; + else if(fptr == &ipsecmod_desetup) return 1; #endif #ifdef CLIENT_SUBNET - else if(fptr == &subnetmod_deinit) return 1; + else if(fptr == &subnetmod_desetup) return 1; #endif #ifdef USE_IPSET - else if(fptr == &ipset_deinit) return 1; + else if(fptr == &ipset_desetup) return 1; #endif return 0; }