Hello community,

here is the log from the commit of package nsd for openSUSE:Factory checked in 
at 2020-04-18 00:32:05
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/nsd (Old)
 and      /work/SRC/openSUSE:Factory/.nsd.new.2738 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "nsd"

Sat Apr 18 00:32:05 2020 rev:16 rq:794852 version:4.3.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/nsd/nsd.changes  2020-03-18 12:52:23.217210351 
+0100
+++ /work/SRC/openSUSE:Factory/.nsd.new.2738/nsd.changes        2020-04-18 
00:33:24.790422897 +0200
@@ -1,0 +2,32 @@
+Thu Apr 16 19:04:58 UTC 2020 - Michael Ströder <mich...@stroeder.com>
+
+- New upstream release 4.3.1
+
+BUG FIXES:
+- Fix #70: error: 'fd_set' undeclared.
+- Fix #71: error: 'for' loop initial declaration used outside C99
+  mode.
+- Fix to move declarations out of for loops in event test too.
+- Fix #76: cpuid typedef for Hurd, DragonflyBSD compile.
+- Fix #75: configure test for sched_setaffinity, and use
+  cpuset_setaffinity otherwise.  Also test for presence of sysconf.
+- Fix #74: GNU Hurd fix cast from pointer to integer of different size.
+- Fix for #74, #75: cpuset test for header contents and provide code.
+- Fix #78: Fix SO_SETFIB error on FreeBSD.
+- Merge PR #83 from noloader: Fix GNU HURD sched_setaffinity compile.
+- Fix #80: NetBSD and implicit declaration of reallocarray.
+- Fix unknown u_long in util.c for Issue #80 .
+- Merge PR #86 from noloader: Use precious variables for GREP, EGREP,
+  SED, AWK, LEX and YACC.
+- For PR #86: Fix that programs loaded after CFLAGS and stuff is
+  set, specifically the compiler, so that it can work if it needs
+  special flags from that.  Fix that lex only needs to support -i
+  if actually defined, otherwise the output included in the source
+  tarball can be used.
+- Merge PR #90 by phicoh: O_CLOEXEC should be FD_CLOEXEC.
+- Merge PR #92 by tonysgi: Fix typo.
+- Merge PR #91 by gearnode: nsd-control-setup recreate certificates.
+  The '-r' option recreates certificates.  Without it it creates them
+  if they do not exist, and does not modify them otherwise.
+
+-------------------------------------------------------------------

Old:
----
  nsd-4.3.0.tar.gz
  nsd-4.3.0.tar.gz.asc

New:
----
  nsd-4.3.1.tar.gz
  nsd-4.3.1.tar.gz.asc

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ nsd.spec ++++++
--- /var/tmp/diff_new_pack.oKW8Oj/_old  2020-04-18 00:33:25.842425075 +0200
+++ /var/tmp/diff_new_pack.oKW8Oj/_new  2020-04-18 00:33:25.842425075 +0200
@@ -23,7 +23,7 @@
 %define zonesdir   %{configdir}/zones
 %define pidfile    %{_rundir}/nsd/nsd.pid
 Name:           nsd
-Version:        4.3.0
+Version:        4.3.1
 Release:        0
 #
 Summary:        An authoritative-only domain name server

++++++ nsd-4.3.0.tar.gz -> nsd-4.3.1.tar.gz ++++++
++++ 2531 lines of diff (skipped)
++++    retrying with extended exclude list
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/nsd-4.3.0/.buildkite/pipeline.yml new/nsd-4.3.1/.buildkite/pipeline.yml
--- old/nsd-4.3.0/.buildkite/pipeline.yml       2020-03-17 11:00:17.000000000 
+0100
+++ new/nsd-4.3.1/.buildkite/pipeline.yml       1970-01-01 01:00:00.000000000 
+0100
@@ -1,7 +0,0 @@
-steps:
-  - label: Build
-    commands:
-    - autoconf && autoheader
-    - ./configure --enable-checking --disable-flto
-    - make
-    - make cutest && ./cutest
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/nsd-4.3.0/.cirrus.yml new/nsd-4.3.1/.cirrus.yml
--- old/nsd-4.3.0/.cirrus.yml   1970-01-01 01:00:00.000000000 +0100
+++ new/nsd-4.3.1/.cirrus.yml   2020-04-16 10:09:33.000000000 +0200
@@ -0,0 +1,139 @@
+# Cirrus CI instructions for building NSD
+#
+# These build instructions are based on the existing instructions and
+# suggestions made by Jeffrey Walton (noloader) about using the Undefined
+# Behavior sanitizer (UBSan) and the Address sanitizer (ASan).
+#
+# For now builds are limited to Linux, FreeBSD and macOS builds on AMD64, more
+# may be added in the future.
+
+ubuntu_1804: &ubuntu_1804
+  container:
+    image: ubuntu:bionic
+  env:
+    UBUNTU_CODENAME: bionic
+    COV_COMPTYPE: gcc
+    COV_PLATFORM: linux64
+
+ubuntu_1804_gcc9: &ubuntu_1804_gcc9
+  <<: *ubuntu_1804
+  env:
+    CC: gcc-9
+  bootstrap_script:
+    - apt-get update
+    - apt-get install -y gnupg2 ca-certificates wget curl
+    - |
+      cat << EOF > /etc/apt/sources.list.d/ubuntu-toolchain-r.list
+      deb http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu 
${UBUNTU_CODENAME} main
+      deb-src http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu 
${UBUNTU_CODENAME} main
+      EOF
+    - apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 1E9377A2BA9EF27F
+    - apt-get update
+  install_script:
+    - apt-get install -y autoconf automake make gcc-9 clang libc-dev 
libevent-dev libssl-dev flex bison
+
+ubuntu_1804_clang10: &ubuntu_1804_clang10
+  <<: *ubuntu_1804
+  env:
+    CC: clang-10
+    CLANG_VERSION: 10
+  bootstrap_script:
+    - apt-get update
+    - apt-get install -y gnupg2 ca-certificates wget curl
+    - |
+      cat << EOF > /etc/apt/sources.list.d/llvm-toolchain.list
+      deb http://apt.llvm.org/${UBUNTU_CODENAME} 
llvm-toolchain-${UBUNTU_CODENAME}-${CLANG_VERSION} main
+      deb-src http://apt.llvm.org/${UBUNTU_CODENAME} 
llvm-toolchain-${UBUNTU_CODENAME}-${CLANG_VERSION} main
+      EOF
+    - apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 15CF4D18AF4F7421
+    - apt-get update
+  install_script:
+    - apt-get install -y autoconf automake make clang-${CLANG_VERSION} 
libc-dev libevent-dev libssl-dev flex bison
+    - update-alternatives --install /usr/bin/clang clang 
/usr/bin/clang-${CLANG_VERSION} 10
+
+freebsd_12_1: &freebsd_12_1
+  freebsd_instance:
+    image_family: freebsd-12-1
+  env:
+    CC: clang
+  install_script:
+    - pkg update -f
+    - pkg install -y bash gmake autoconf automake libevent
+
+macos_1015_xcode11: &macos_1015_xcode11
+  osx_instance:
+    image: catalina-xcode-11.3.1
+  env:
+    CC: clang
+    COV_COMPTYPE: clang
+    COV_COMPTYPE: macOSX
+  install_script:
+    - brew install bash autoconf automake libtool libevent openssl flex bison
+
+install_coverity: &install_coverity
+  env:
+    COV_ARC: "$CIRRUS_WORKING_DIR/cov-analysis-$COV_PLATFORM.tgz"
+    COV_DIR: "$CIRRUS_WORKING_DIR/coverity-scan-analysis"
+    PATH: "$PATH:$CIRRUS_WORKING_DIR/cov-analysis/bin"
+  install_coverity_script:
+    - test ! -d "${COV_DIR}" &&
+      mkdir -p "${COV_DIR}" &&
+      curl -s -S -F project="${CIRRUS_REPO_OWNER}/${CIRRUS_REPO_NAME}"
+                 -F token="${COVERITY_SCAN_TOKEN}"
+                 -o "${COV_ARC}"
+                 "https://scan.coverity.com/download/cxx/${COV_PLATFORM}"; &&
+      tar -xzf "${COV_ARC}" -C "${COV_DIR}"
+    - ln -s $(find "${COV_DIR}" -type d -name "cov-analysis*") cov-analysis
+
+submit_to_coverity_scan: &submit_to_coverity_scan
+  submit_to_coverity_scan_script:
+    - tar -czf analysis-results.tgz cov-int
+    - curl -s -S -F project="${CIRRUS_REPO_OWNER}/${CIRRUS_REPO_NAME}"
+                 -F token="${COVERITY_SCAN_TOKEN}"
+                 -F file=@analysis-results.tgz
+                 -F version="$(git rev-parse --short HEAD)"
+                 -F description="Cirrus CI build"
+                 -F email="${COVERITY_EMAIL:=s...@nlnetlabs.nl}"
+                 "https://scan.coverity.com/builds";
+
+env:
+  COVERITY_EMAIL: 
ENCRYPTED[effa3340c97e8cf92c0dbb564187d35b6829580cc2577b176d6c6fc9b775745f7130c56f5bd9ab2472f4ae818b6f3791]
+  COVERITY_SCAN_TOKEN: 
ENCRYPTED[8f67f850ca3d464ea87fa8dee17bbb0cfb2a991b6f401fd593fe0744eece838e325af438d62ee2d46c4e18a2bd5c873f]
+
+task:
+  only_if: $CIRRUS_CRON != ''
+  name: "Build on Ubuntu 18.04 LTS with GCC 9 (Coverity Scan)"
+  <<: *ubuntu_1804_gcc9
+  <<: *install_coverity
+  build_script:
+    - autoconf && autoheader
+    - ./configure --enable-checking --disable-flto
+    - cov-configure --comptype ${COV_COMPTYPE} --compiler ${CC} --template
+    - cov-build --dir cov-int make
+  <<: *submit_to_coverity_scan
+
+task:
+  matrix:
+    - name: "Build and test on Ubuntu 18.04 LTS with GCC 9"
+      <<: *ubuntu_1804_gcc9
+    - name: "Build and test on Ubuntu 18.04 LTS with Clang 10 
(ASan+UBSan+LSan)"
+      <<: *ubuntu_1804_clang10
+      env:
+        CFLAGS: "-g2 -O0 -fsanitize=address,undefined,leak 
-fno-sanitize-recover=all"
+    - name: "Build and test on FreeBSD 12.1 (ASan+UBSan)"
+      <<: *freebsd_12_1
+      env:
+        CFLAGS: "-g2 -O0 -fsanitize=address,undefined 
-fno-sanitize-recover=all"
+    - name: "Build and test on macOS 10.15 with Xcode 11.3.1 (ASan+UBSan)"
+      <<: *macos_1015_xcode11
+      env:
+        CFLAGS: "-g2 -O0 -fsanitize=address,undefined 
-fno-sanitize-recover=all"
+
+  build_script:
+    - autoconf && autoheader
+    - ./configure --enable-checking --disable-flto --with-ssl=yes 
--with-libevent=yes
+    - make -j 2
+    - make cutest
+    - ./cutest
+    - (cd tpkg/clang-analysis.tdir && bash clang-analysis.test)
+    - (cd tpkg && ./mini_tdir.sh -a ../.. exe checkconf.tdir)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/nsd-4.3.0/.travis.yml new/nsd-4.3.1/.travis.yml
--- old/nsd-4.3.0/.travis.yml   2020-03-17 11:00:17.000000000 +0100
+++ new/nsd-4.3.1/.travis.yml   1970-01-01 01:00:00.000000000 +0100
@@ -1,67 +0,0 @@
-sudo: false
-language: c
-
-linux_gcc: &linux_gcc
-  os: linux
-  dist: bionic
-  compiler: gcc
-  addons:
-    apt:
-      update: true
-      sources:
-        - sourceline: 'ppa:ubuntu-toolchain-r/test'
-      packages: [ autoconf bison flex libssl-dev libevent-dev clang gcc-9 ]
-  before_install:
-    - eval "export CC=gcc-9"
-    - eval "export COV_COMPTYPE=gcc COV_PLATFORM=linux64"
-
-install_coverity: &install_coverity
-  if [ "${COVERITY_SCAN}" = "true" ]; then
-    COV_DIR="/tmp/coverity-scan-analysis";
-    COV_ARC="/tmp/cov-analysis-${COV_PLATFORM}.tgz";
-    test ! -d "${COV_DIR}" &&
-      mkdir -p "${COV_DIR}" &&
-      curl -s -S -F project="${TRAVIS_REPO_SLUG}"
-                 -F token="${COVERITY_SCAN_TOKEN}"
-                 -o "${COV_ARC}"
-                 "https://scan.coverity.com/download/cxx/${COV_PLATFORM}"; &&
-      tar -xzf "${COV_ARC}" -C "${COV_DIR}";
-    COV_ANALYSIS=$(find "${COV_DIR}" -type d -name "cov-analysis*");
-    eval "export PATH=\"${PATH}:${COV_ANALYSIS}/bin\"";
-    eval "export SCAN_BUILD=\"cov-build --dir cov-int\"";
-    cov-configure --comptype ${COV_COMPTYPE} --compiler ${CC} --template;
-  fi
-
-submit_to_coverity_scan: &submit_to_coverity_scan
-  if [ "${COVERITY_SCAN}" = "true" ]; then
-    tar -czf analysis-results.tgz cov-int &&
-    curl -s -S -F project="${TRAVIS_REPO_SLUG}"
-               -F token="${COVERITY_SCAN_TOKEN}"
-               -F file=@analysis-results.tgz
-               -F version=$(git rev-parse --short HEAD)
-               -F description="Travis CI build"
-               -F email="${COVERITY_EMAIL:=s...@nlnetlabs.nl}"
-               "https://scan.coverity.com/builds";;
-  fi
-
-install:
-  - *install_coverity
-
-script:
-  - autoconf && autoheader
-  - ./configure --enable-checking --disable-flto
-  - ${SCAN_BUILD} make
-  - make cutest && ./cutest
-  - (cd tpkg; cd clang-analysis.tdir; bash clang-analysis.test)
-
-after_success:
-  - *submit_to_coverity_scan
-
-jobs:
-  include:
-    - <<: *linux_gcc
-      env: [ COVERITY_SCAN=true ]
-      if: type = cron
-    - <<: *linux_gcc
-      env: [ COVERITY_SCAN=false ]
-
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/nsd-4.3.0/README.md new/nsd-4.3.1/README.md
--- old/nsd-4.3.0/README.md     2020-03-17 11:00:17.000000000 +0100
+++ new/nsd-4.3.1/README.md     2020-04-16 10:09:33.000000000 +0200
@@ -11,7 +11,7 @@
 [create an issue on Github](https://github.com/NLnetLabs/nsd/issues/new)
 or post a message on the
 [NSD mailing list](https://lists.nlnetlabs.nl/mailman/listinfo/nsd-users).
-You can lean more about NSD by reading our
+You can learn more about NSD by reading our
 [documentation](https://nlnetlabs.nl/documentation/nsd/).
 
 ## Compiling
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/nsd-4.3.0/compat/cpuset.c new/nsd-4.3.1/compat/cpuset.c
--- old/nsd-4.3.0/compat/cpuset.c       2020-03-17 11:00:17.000000000 +0100
+++ new/nsd-4.3.1/compat/cpuset.c       2020-04-16 10:09:33.000000000 +0200
@@ -13,78 +13,65 @@
 #include <unistd.h>
 
 #ifndef HAVE_CPUSET_CREATE
-#if __linux__ || __FreeBSD__
 cpuset_t *cpuset_create(void)
 {
   cpuset_t *set = calloc(1, sizeof(*set));
   return set;
 }
-#endif
 #endif /* !HAVE_CPUSET_CREATE */
 
 #ifndef HAVE_CPUSET_DESTROY
-#if __linux__ || __FreeBSD__
 void cpuset_destroy(cpuset_t *set)
 {
   free(set);
 }
-#endif
 #endif /* !HAVE_CPUSET_DESTROY */
 
 #ifndef HAVE_CPUSET_ZERO
-#if __linux__ || __FreeBSD__
 void cpuset_zero(cpuset_t *set)
 {
   CPU_ZERO(set);
 }
-#endif
 #endif /* !HAVE_CPUSET_ZERO */
 
 #ifndef HAVE_CPUSET_SET
-#if __linux__ || __FreeBSD__
 int cpuset_set(cpuid_t cpu, cpuset_t *set)
 {
   CPU_SET(cpu, set);
   return 0;
 }
-#endif
 #endif /* !HAVE_CPUSET_SET */
 
 #ifndef HAVE_CPUSET_CLR
-#if __linux__ || __FreeBSD__
 int cpuset_clr(cpuid_t cpu, cpuset_t *set)
 {
   CPU_CLR(cpu, set);
   return 0;
 }
-#endif
 #endif /* !HAVE_CPUSET_CLR */
 
 #ifndef HAVE_CPUSET_ISSET
-#if __linux__ || __FreeBSD__
 int cpuset_isset(cpuid_t cpu, const cpuset_t *set)
 {
   return CPU_ISSET(cpu, set);
 }
-#endif
 #endif /* !HAVE_CPUSET_ISSET */
 
 #ifndef HAVE_CPUSET_SIZE
-#if __linux__ || __FreeBSD__
 size_t cpuset_size(const cpuset_t *set)
 {
   return sizeof(*set);
 }
-#endif
 #endif /* !HAVE_CPUSET_SIZE */
 
-#if __linux__
+#ifdef CPU_OR_THREE_ARGS
+/* for Linux, use three arguments */
 void cpuset_or(cpuset_t *destset, const cpuset_t *srcset)
 {
   CPU_OR(destset, destset, srcset);
 }
-#endif
-#if __FreeBSD__
+#else
+/* for FreeBSD, use two arguments */
 void cpuset_or(cpuset_t *destset, const cpuset_t *srcset)
 {
   CPU_OR(destset, srcset);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/nsd-4.3.0/compat/cpuset.h new/nsd-4.3.1/compat/cpuset.h
--- old/nsd-4.3.0/compat/cpuset.h       2020-03-17 11:00:17.000000000 +0100
+++ new/nsd-4.3.1/compat/cpuset.h       2020-04-16 10:09:33.000000000 +0200
@@ -40,8 +40,9 @@
 #ifndef HAVE_CPUID_T
 #ifdef __linux__
 typedef int cpuid_t;
-#endif
-#ifdef __FreeBSD__
+#elif defined(__FreeBSD__) || defined(__gnu_hurd__) || defined(__DragonFly__)
+typedef size_t cpuid_t;
+#else
 typedef size_t cpuid_t;
 #endif
 #endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/nsd-4.3.0/config.h.in new/nsd-4.3.1/config.h.in
--- old/nsd-4.3.0/config.h.in   2020-03-17 11:00:17.000000000 +0100
+++ new/nsd-4.3.1/config.h.in   2020-04-16 10:09:34.000000000 +0200
@@ -15,6 +15,9 @@
 /* Pathname to the NSD configuration file */
 #undef CONFIGFILE
 
+/* number of arguments for CPU_OR is three */
+#undef CPU_OR_THREE_ARGS
+
 /* Define this if on macOSX10.4-darwin8 and setreuid and setregid do not work
    */
 #undef DARWIN_BROKEN_SETREUID
@@ -88,6 +91,10 @@
 /* if time.h provides ctime_r prototype */
 #undef HAVE_CTIME_R_PROTO
 
+/* Define to 1 if you have the declaration of `reallocarray', and to 0 if you
+   don't. */
+#undef HAVE_DECL_REALLOCARRAY
+
 /* Define to 1 if you have the declaration of `SSL_CTX_set_ecdh_auto', and to
    0 if you don't. */
 #undef HAVE_DECL_SSL_CTX_SET_ECDH_AUTO
@@ -280,6 +287,9 @@
 /* Define to 1 if you have the <sched.h> header file. */
 #undef HAVE_SCHED_H
 
+/* Define this if sched_setaffinity is available */
+#undef HAVE_SCHED_SETAFFINITY
+
 /* Define if sendmmsg is implemented */
 #undef HAVE_SENDMMSG
 
@@ -382,6 +392,9 @@
 /* If time.h has a struct timespec (for pselect). */
 #undef HAVE_STRUCT_TIMESPEC
 
+/* Define to 1 if you have the `sysconf' function. */
+#undef HAVE_SYSCONF
+
 /* Define to 1 if you have the <syslog.h> header file. */
 #undef HAVE_SYSLOG_H
 
@@ -521,6 +534,9 @@
 /* Define this to set ratelimit to off by default. */
 #undef RATELIMIT_DEFAULT_OFF
 
+/* If reallocarray needs defines to appear in the headers */
+#undef REALLOCARRAY_NEEDS_DEFINES
+
 /* Define as the return type of signal handlers (`int' or `void'). */
 #undef RETSIGTYPE
 
@@ -731,7 +747,7 @@
 /* define before includes as it specifies what standard to use. */
 #if (defined(HAVE_PSELECT) && !defined (HAVE_PSELECT_PROTO)) \
        || !defined (HAVE_CTIME_R_PROTO) \
-       || defined (STRPTIME_NEEDS_DEFINES)
+       || defined (STRPTIME_NEEDS_DEFINES) || 
defined(REALLOCARRAY_NEEDS_DEFINES)
 #  ifndef _XOPEN_SOURCE
 #    define _XOPEN_SOURCE 600
 #  endif
@@ -749,7 +765,7 @@
 #  endif
 #  ifndef __EXTENSIONS__
 #    define __EXTENSIONS__ 1
-#  endif 
+#  endif
 #  ifndef _STDC_C99
 #    define _STDC_C99 1
 #  endif
@@ -879,11 +895,11 @@
 #endif
 #ifndef HAVE_STRPTIME
 #define HAVE_STRPTIME 1
-char *strptime(const char *s, const char *format, struct tm *tm); 
+char *strptime(const char *s, const char *format, struct tm *tm);
 #endif
 #ifndef STRPTIME_WORKS
 #define STRPTIME_WORKS 1
-char *nsd_strptime(const char *s, const char *format, struct tm *tm); 
+char *nsd_strptime(const char *s, const char *format, struct tm *tm);
 #define strptime(a,b,c) nsd_strptime((a),(b),(c))
 #endif
 #if (HAVE_CPU_SET_T || HAVE_CPUSET_T)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/nsd-4.3.0/configure.ac new/nsd-4.3.1/configure.ac
--- old/nsd-4.3.0/configure.ac  2020-03-17 11:00:17.000000000 +0100
+++ new/nsd-4.3.1/configure.ac  2020-04-16 10:09:33.000000000 +0200
@@ -5,9 +5,20 @@
 sinclude(acx_nlnetlabs.m4)
 sinclude(dnstap/dnstap.m4)
 
-AC_INIT(NSD,4.3.0,nsd-b...@nlnetlabs.nl)
+AC_INIT(NSD,4.3.1,nsd-b...@nlnetlabs.nl)
 AC_CONFIG_HEADER([config.h])
 
+#
+# Setup the standard programs
+# 
https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Setting-Output-Variables.html
+
+AC_ARG_VAR(SED, [location of the sed program])
+AC_ARG_VAR(AWK, [location of the awk program])
+AC_ARG_VAR(GREP, [location of the grep program])
+AC_ARG_VAR(EGREP, [location of the egrep program])
+AC_ARG_VAR(LEX, [location of the lex program with GNU extensions (flex)])
+AC_ARG_VAR(YACC, [location of the yacc program with GNU extensions (bison)])
+
 CFLAGS="$CFLAGS"
 AC_AIX
 if test "$ac_cv_header_minix_config_h" = "yes"; then
@@ -112,21 +123,21 @@
 
 # default xfrd file location.
 xfrdfile=${dbdir}/xfrd.state
-AC_ARG_WITH([xfrdfile], AC_HELP_STRING([--with-xfrdfile=path], 
+AC_ARG_WITH([xfrdfile], AC_HELP_STRING([--with-xfrdfile=path],
        [Pathname to the NSD xfrd zone timer state file]), [xfrdfile=$withval])
 AC_DEFINE_UNQUOTED(XFRDFILE, ["`eval echo $xfrdfile`"], [Pathname to the NSD 
xfrd zone timer state file.])
 AC_SUBST(xfrdfile)
 
 # default zonelist file location.
 zonelistfile=${dbdir}/zone.list
-AC_ARG_WITH([zonelistfile], AC_HELP_STRING([--with-zonelistfile=path], 
+AC_ARG_WITH([zonelistfile], AC_HELP_STRING([--with-zonelistfile=path],
        [Pathname to the NSD zone list file]), [zonelistfile=$withval])
 AC_DEFINE_UNQUOTED(ZONELISTFILE, ["`eval echo $zonelistfile`"], [Pathname to 
the NSD zone list file.])
 AC_SUBST(zonelistfile)
 
 # default xfr dir location.
 xfrdir="/tmp"
-AC_ARG_WITH([xfrdir], AC_HELP_STRING([--with-xfrdir=path], 
+AC_ARG_WITH([xfrdir], AC_HELP_STRING([--with-xfrdir=path],
        [Pathname to where the NSD transfer dir is created]), [xfrdir=$withval])
 AC_DEFINE_UNQUOTED(XFRDIR, ["`eval echo $xfrdir`"], [Pathname to where the NSD 
transfer dir is created.])
 AC_SUBST(xfrdir)
@@ -163,23 +174,38 @@
 AC_SUBST(user)
 AC_DEFINE_UNQUOTED(USER, ["$user"], [the user name to drop privileges to])
 
-# Checks for programs.
-AC_PROG_AWK
 AC_PROG_CC
-AC_PROG_LN_S
-AC_PROG_INSTALL
+AC_PROG_SED
+AC_PROG_AWK
+AC_PROG_GREP
+AC_PROG_EGREP
 AC_PROG_LEX
 AC_PROG_YACC
+AC_PROG_LN_S
+AC_PROG_INSTALL
 
 if test "$LEX" != ":" -a "$LEX" != ""; then
+# Solaris provides anemic tools, and they don't offer GNU extensions like
+# 'flex -i'. Solaris also does not offer GNU replacements in /usr/gnu/bin.
+AC_MSG_CHECKING([whether lex accepts -i])
+AS_IF([echo "%%" | $LEX -i -t >/dev/null 2>&1],
+  [
+    AC_MSG_RESULT([yes])
+  ],
+  [
+    AC_MSG_RESULT([no])
+    AC_MSG_ERROR([unable to find a lexer that supports -i. If one is available 
then set the LEX variable])
+  ]
+)
+
   # Check if lex defines yy_current_buffer, because 2.4.6 and older use it,
   # but later could define it as a macro and then we should not redefine it.
   AC_MSG_CHECKING(if lex defines yy_current_buffer)
   cat <<EOF >conftest.lex
 %%
 EOF
-  $LEX -i -t conftest.lex >> conftest.c
-  if grep "^#define yy_current_buffer" conftest.c >/dev/null; then
+  $LEX -i -t conftest.lex >> conftest.c 2>/dev/null
+  if $GREP "^#define yy_current_buffer" conftest.c >/dev/null; then
          AC_DEFINE_UNQUOTED(LEX_DEFINES_YY_CURRENT_BUFFER, 1, [If flex defines 
yy_current_buffer as a macro])
        AC_MSG_RESULT(yes)
   else
@@ -257,7 +283,7 @@
 [
 AC_REQUIRE([AC_PROG_CC])
 AC_MSG_CHECKING(whether $CC supports -$1)
-cache=`echo $1 | sed 'y%.=/+-%___p_%'`
+cache=`echo $1 | $SED 'y%.=/+-%___p_%'`
 AC_CACHE_VAL(cv_prog_cc_flag_$cache,
 [
 echo 'void f(){}' >conftest.c
@@ -331,14 +357,14 @@
 AC_DEFUN([CHECK_SSL], [
     AC_ARG_WITH(ssl, AC_HELP_STRING([--with-ssl=pathname],
                 [enable SSL (will check /usr/local/ssl
-                /usr/lib/ssl /usr/ssl /usr/pkg /usr/sfw /usr/local /usr)]),[
+                /usr/lib/ssl /usr/ssl /usr/pkg /usr/sfw /usr/local /usr 
/usr/local/opt/openssl)]),[
         ],[
             withval="yes"
         ])
     if test x_$withval != x_no; then
         AC_MSG_CHECKING(for SSL)
         if test x_$withval = x_ -o x_$withval = x_yes; then
-            withval="/usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg /usr/sfw 
/usr/local /usr"
+            withval="/usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg /usr/sfw 
/usr/local /usr /usr/local/opt/openssl"
         fi
         for dir in $withval; do
             ssldir="$dir"
@@ -350,12 +376,12 @@
                 fi
                 break;
             fi
-        done 
+        done
         if test x_$found_ssl != x_yes; then
             AC_MSG_ERROR(Cannot find the SSL libraries in $withval)
         else
             AC_MSG_RESULT(found in $ssldir)
-            HAVE_SSL=yes 
+            HAVE_SSL=yes
             if test x_$ssldir != x_/usr; then
                 LDFLAGS="$LDFLAGS -L$ssldir/lib";
             fi
@@ -369,12 +395,12 @@
 
 # check for libevent
 AC_ARG_WITH(libevent, AC_HELP_STRING([--with-libevent=pathname],
-    [use libevent (will check /usr/local /opt/local /usr/lib /usr/pkg /usr/sfw 
/usr  or you can specify an explicit path), useful when the zone count is 
high.]),
+    [use libevent (will check /usr/local /opt/local /usr/lib /usr/pkg /usr/sfw 
/usr /usr/local/opt/libevent or you can specify an explicit path), useful when 
the zone count is high.]),
     [ ],[ withval="yes" ])
 if test x_$withval = x_yes -o x_$withval != x_no; then
         AC_MSG_CHECKING(for libevent)
         if test x_$withval = x_ -o x_$withval = x_yes; then
-            withval="/usr/local /opt/local /usr/lib /usr/pkg /usr/sfw /usr"
+            withval="/usr/local /opt/local /usr/lib /usr/pkg /usr/sfw /usr 
/usr/local/opt/libevent"
         fi
         for dir in $withval; do
             thedir="$dir"
@@ -393,7 +419,7 @@
                        AC_MSG_RESULT(found in $thedir)
                        CPPFLAGS="$CPPFLAGS -I$thedir -I$thedir/include"
                        # remove evdns from linking
-                       ev_files_o=`ls $thedir/*.o | grep -v evdns\.o | grep -v 
bufferevent_openssl\.o`
+                       ev_files_o=`ls $thedir/*.o | $GREP -v evdns\.o | $GREP 
-v bufferevent_openssl\.o`
                        cp $ev_files_o .
                        LDFLAGS="$ev_files_o $LDFLAGS -lm"
                else
@@ -505,7 +531,7 @@
 AC_RUN_IFELSE([AC_LANG_SOURCE([[
 #define _XOPEN_SOURCE 600
 #include <time.h>
-int main(void) { struct tm tm; char *res; 
+int main(void) { struct tm tm; char *res;
 res = strptime("20070207111842", "%Y%m%d%H%M%S", &tm);
 if (!res) return 1; return 0; }
 ]])] , [eval "ac_cv_c_strptime_works=yes"], [eval "ac_cv_c_strptime_works=no"])
@@ -588,7 +614,7 @@
 fi
 ])
 
-AC_LIBGTOP_CHECK_TYPE(int8_t, char) 
+AC_LIBGTOP_CHECK_TYPE(int8_t, char)
 AC_LIBGTOP_CHECK_TYPE(int16_t, short)
 AC_LIBGTOP_CHECK_TYPE(int32_t, int)
 AC_LIBGTOP_CHECK_TYPE(int64_t, long long)
@@ -643,7 +669,7 @@
 #include <sys/socket.h>
 #include <errno.h>
 int main(void)
-{ 
+{
        int s = socket(AF_INET, SOCK_DGRAM, 0);
        int r = recvmmsg(s, 0, 0, 0, 0) == -1 && errno == ENOSYS;
        close(s);
@@ -659,7 +685,7 @@
 #include <sys/socket.h>
 #include <errno.h>
 int main(void)
-{ 
+{
        int s = socket(AF_INET, SOCK_DGRAM, 0);
        int r = sendmmsg(s, 0, 0, 0) == -1 && errno == ENOSYS;
        close(s);
@@ -677,10 +703,16 @@
 esac
 
 # check if setreuid en setregid fail, on MacOSX10.4(darwin8).
-if echo $target_os | grep darwin8 > /dev/null; then
+if echo $target_os | $GREP -i darwin8 > /dev/null; then
        AC_DEFINE(DARWIN_BROKEN_SETREUID, 1, [Define this if on 
macOSX10.4-darwin8 and setreuid and setregid do not work])
 fi
 
+# GNU HURD needs _GNU_SOURCE defined for cpu affinity gear
+if echo $target_os | $EGREP -i 'linux|hurd' > /dev/null; then
+  AC_DEFINE([_GNU_SOURCE, 1, [Define this if on Linux or GNU Hurd for cpu 
affinity interface]])
+fi
+
+# see comment on _GNU_SOURCE above
 AC_CHECK_HEADERS([sched.h sys/cpuset.h])
 
 # Check for cpu_set_t (Linux) and cpuset_t (FreeBSD and NetBSD)
@@ -694,6 +726,37 @@
 #endif
 ])
 
+AC_DEFUN([AC_CHECK_CPU_OR],
+[AC_REQUIRE([AC_PROG_CC])
+AC_MSG_CHECKING(whether CPU_OR works with three arguments)
+AC_TRY_COMPILE(
+[#ifdef HAVE_SCHED_H
+# include <sched.h>
+#endif
+#ifdef HAVE_SYS_CPUSET_H
+# include <sys/cpuset.h>
+#endif
+#include <string.h>
+#ifdef HAVE_CPUSET_T
+#define MY_CPUSET_TYPE cpuset_t
+#endif
+#ifdef HAVE_CPU_SET_T
+#define MY_CPUSET_TYPE cpu_set_t
+#endif
+void testing (void) {
+       MY_CPUSET_TYPE a, b;
+       memset(&a, 0, sizeof(a));
+       memset(&b, 0, sizeof(b));
+       CPU_OR(&a, &a, &b);
+}], [
+        testing();
+], [
+       AC_MSG_RESULT(yes)
+       AC_DEFINE([CPU_OR_THREE_ARGS], 1, [number of arguments for CPU_OR is 
three])
+], [
+       AC_MSG_RESULT(no)
+])])
+
 AS_IF([test x"$ac_cv_type_cpuset_t" = xyes -o x"$ac_cv_type_cpu_set_t" = xyes 
],[
        AC_CHECK_FUNC(cpuset_create)
        AC_CHECK_FUNC(cpuset_destroy)
@@ -703,9 +766,41 @@
        AC_CHECK_FUNC(cpuset_isset)
        AC_CHECK_FUNC(cpuset_size)
        AC_LIBOBJ(cpuset)
+       AC_CHECK_FUNCS([sysconf])
+       AC_CHECK_CPU_OR
 ])
 
 #
+# sched_setaffinity must be checked using proper includes.
+# also needs _GNU_SOURCE on Linux and Hurd; see above.
+# also see https://github.com/NLnetLabs/nsd/issues/82.
+#
+AC_MSG_CHECKING(for sched_setaffinity)
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+  [[
+    #ifdef HAVE_SCHED_H
+    # include <sched.h>
+    #endif
+    #ifdef HAVE_SYS_CPUSET_H
+    #include <sys/cpuset.h>
+    #endif
+    #ifdef HAVE_CPUSET_T
+    #define MY_CPUSET_TYPE cpuset_t
+    #endif
+    #ifdef HAVE_CPU_SET_T
+    #define MY_CPUSET_TYPE cpu_set_t
+    #endif
+    void testing (void) {
+      MY_CPUSET_TYPE set;
+      CPU_ZERO(&set);
+      (void)sched_setaffinity(-1, sizeof(set), &set);
+    }
+]])],
+[  AC_MSG_RESULT(yes)
+   AC_DEFINE(HAVE_SCHED_SETAFFINITY, 1, [Define this if sched_setaffinity is 
available])],
+[  AC_MSG_RESULT(no)])
+
+#
 # Checking for missing functions we can replace
 #
 AC_REPLACE_FUNCS(basename)
@@ -722,11 +817,14 @@
 AC_REPLACE_FUNCS(memmove)
 AC_REPLACE_FUNCS(setproctitle)
 AC_MSG_CHECKING([for reallocarray])
-AC_LINK_IFELSE([AC_LANG_SOURCE(AC_INCLUDES_DEFAULT
+AC_LINK_IFELSE([AC_LANG_SOURCE(
 [[
 #ifndef _OPENBSD_SOURCE
 #define _OPENBSD_SOURCE 1
 #endif
+]]
+AC_INCLUDES_DEFAULT
+[[
 #include <stdlib.h>
 int main(void) {
        void* p = reallocarray(NULL, 10, 100);
@@ -735,17 +833,23 @@
 }
 ]])], [AC_MSG_RESULT(yes)
        AC_DEFINE(HAVE_REALLOCARRAY, 1, [If we have reallocarray(3)])
+       AC_CHECK_DECLS([reallocarray], [], [
+               AC_DEFINE(REALLOCARRAY_NEEDS_DEFINES, 1, [If reallocarray needs 
defines to appear in the headers])
+       ], [
+AC_INCLUDES_DEFAULT
+#include <stdlib.h>
+       ])
 ], [
        AC_MSG_RESULT(no)
        AC_LIBOBJ(reallocarray)
 ])
 
 AC_MSG_CHECKING(for pselect prototype in sys/select.h)
-AC_EGREP_HEADER([[^a-zA-Z_]*pselect[^a-zA-Z_]], sys/select.h, 
AC_DEFINE(HAVE_PSELECT_PROTO, 1, 
+AC_EGREP_HEADER([[^a-zA-Z_]*pselect[^a-zA-Z_]], sys/select.h, 
AC_DEFINE(HAVE_PSELECT_PROTO, 1,
        [if sys/select.h provides pselect prototype]) AC_MSG_RESULT(yes), 
AC_MSG_RESULT(no))
 
 AC_MSG_CHECKING(for ctime_r prototype in time.h)
-AC_EGREP_HEADER([[^a-zA-Z_]*ctime_r[^a-zA-Z_]], time.h, 
AC_DEFINE(HAVE_CTIME_R_PROTO, 1, 
+AC_EGREP_HEADER([[^a-zA-Z_]*ctime_r[^a-zA-Z_]], time.h, 
AC_DEFINE(HAVE_CTIME_R_PROTO, 1,
        [if time.h provides ctime_r prototype]) AC_MSG_RESULT(yes), 
AC_MSG_RESULT(no))
 
 AC_CHECK_TYPE([struct timespec], AC_DEFINE(HAVE_STRUCT_TIMESPEC, 1, [If time.h 
has a struct timespec (for pselect).]), [], [
@@ -901,7 +1005,7 @@
        ])
        LIBS="$BAKLIBS"
 
-       if test -n "$ssldir"; then 
+       if test -n "$ssldir"; then
             AC_CHECK_LIB(crypto, HMAC_Update,, [
                     AC_MSG_ERROR([OpenSSL found in $ssldir, but version 0.9.7 
or higher is required])
                 ])
@@ -1038,7 +1142,7 @@
 /* define before includes as it specifies what standard to use. */
 #if (defined(HAVE_PSELECT) && !defined (HAVE_PSELECT_PROTO)) \
        || !defined (HAVE_CTIME_R_PROTO) \
-       || defined (STRPTIME_NEEDS_DEFINES)
+       || defined (STRPTIME_NEEDS_DEFINES) || 
defined(REALLOCARRAY_NEEDS_DEFINES)
 #  ifndef _XOPEN_SOURCE
 #    define _XOPEN_SOURCE 600
 #  endif
@@ -1056,7 +1160,7 @@
 #  endif
 #  ifndef __EXTENSIONS__
 #    define __EXTENSIONS__ 1
-#  endif 
+#  endif
 #  ifndef _STDC_C99
 #    define _STDC_C99 1
 #  endif
@@ -1190,11 +1294,11 @@
 #endif
 #ifndef HAVE_STRPTIME
 #define HAVE_STRPTIME 1
-char *strptime(const char *s, const char *format, struct tm *tm); 
+char *strptime(const char *s, const char *format, struct tm *tm);
 #endif
 #ifndef STRPTIME_WORKS
 #define STRPTIME_WORKS 1
-char *nsd_strptime(const char *s, const char *format, struct tm *tm); 
+char *nsd_strptime(const char *s, const char *format, struct tm *tm);
 #define strptime(a,b,c) nsd_strptime((a),(b),(c))
 #endif
 #if (HAVE_CPU_SET_T || HAVE_CPUSET_T)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/nsd-4.3.0/doc/ChangeLog new/nsd-4.3.1/doc/ChangeLog
--- old/nsd-4.3.0/doc/ChangeLog 2020-03-17 11:00:17.000000000 +0100
+++ new/nsd-4.3.1/doc/ChangeLog 2020-04-16 10:09:33.000000000 +0200
@@ -1,3 +1,62 @@
+8 April 2020: Wouter
+       - Tag for 4.3.1rc2.
+
+7 April 2020: Wouter
+       - Merge PR #91 by gearnode: nsd-control-setup recreate certificates.
+         The '-r' option recreates certificates.  Without it it creates them
+         if they do not exist, and does not modify them otherwise.
+
+6 April 2020: Wouter
+       - Merge PR #90 by phicoh: O_CLOEXEC should be FD_CLOEXEC.
+       - Merge PR #92 by tonysgi: Fix typo.
+
+2 April 2020: Wouter
+       - Tag for 4.3.1rc1.
+
+1 April 2020: Wouter
+       - Fix for whitespace in minimal responses test for FreeBSD.
+
+25 March 2020: Wouter
+       - Merge PR #86 from noloader: Use precious variables for GREP, EGREP,
+         SED, AWK, LEX and YACC.
+       - For PR #86: Fix that programs loaded after CFLAGS and stuff is
+         set, specifically the compiler, so that it can work if it needs
+         special flags from that.  Fix that lex only needs to support -i
+         if actually defined, otherwise the output included in the source
+         tarball can be used.
+       - Merge PR #72 from noloader: Increase Travis testing coverage
+
+23 March 2020: Wouter
+       - Fix unterminated ifdef in nsd.h.
+       - Fix unknown u_long in util.c for Issue #80 .
+
+20 March 2020: Wouter
+       - Merge PR #83 from noloader: Fix GNU HURD sched_setaffinity compile.
+       - Fix #82: print error when system does not have setaffinity.
+       - Fix #80: NetBSD and implicit declaration of reallocarray.
+       - Fix for #80: Fix reallocarray test to define before include.
+       - Fix for #80: Define alternatives for IFNAMSIZ if it does not exist.
+
+19 March 2020: Wouter
+       - Fix #76: cpuid typedef for Hurd, DragonflyBSD compile.
+       - Fix #75: configure test for sched_setaffinity, and use
+         cpuset_setaffinity otherwise.  Also test for presence of sysconf.
+       - Fix #74: GNU Hurd fix cast from pointer to integer of different size.
+       - Fix for #74, #75: cpuset test for header contents and provide code.
+       - Fix #78: Fix SO_SETFIB error on FreeBSD.
+
+18 March 2020: Wouter
+       - Fix #70: error: 'fd_set' undeclared.
+       - Fix #71: error: 'for' loop initial declaration used outside C99
+         mode.
+       - Fix to move declarations out of for loops in event test too.
+       - Fix to move declarations out of for loops in popen3 test too.
+       - Another fix to move declaration out of for loop for event test.
+       - Fix to move declarations out of for loops in cutest regex display.
+
+17 March 2020: Wouter
+       - tag for 4.3.0 release and master branch has version 4.3.1.
+
 10 March 2020: Wouter
        - repository has version number 4.3.0.  Tag for 4.3.0rc1.
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/nsd-4.3.0/doc/README new/nsd-4.3.1/doc/README
--- old/nsd-4.3.0/doc/README    2020-03-17 11:00:18.000000000 +0100
+++ new/nsd-4.3.1/doc/README    2020-04-16 10:09:34.000000000 +0200
@@ -20,7 +20,7 @@
 
 1.0 Introduction
 
-This is NSD Name Server Daemon (NSD) version 4.3.0.
+This is NSD Name Server Daemon (NSD) version 4.3.1.
 
 The NLnet Labs Name Server Daemon (NSD) is an authoritative RFC compliant 
 DNS nameserver. It was first conceived to allow for more genetic 
@@ -56,7 +56,7 @@
 
 1.2 Quick build and install
 
-Step 1: Unpack the source with gtar -xzvf nsd-4.3.0.tar.gz
+Step 1: Unpack the source with gtar -xzvf nsd-4.3.1.tar.gz
 
 Step 2: Create user nsd or any other unprivileged user of your
         choice. In case of later make sure to use
@@ -110,9 +110,9 @@
 Use your favorite combination of tar and gnu zip to unpack the source,
 for example
 
-$ gtar -xzvf nsd-4.3.0.tar.gz
+$ gtar -xzvf nsd-4.3.1.tar.gz
 
-will unpack the source into the ./nsd-4.3.0 directory...
+will unpack the source into the ./nsd-4.3.1 directory...
 
 
 2.2 Configuring NSD
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/nsd-4.3.0/doc/RELNOTES new/nsd-4.3.1/doc/RELNOTES
--- old/nsd-4.3.0/doc/RELNOTES  2020-03-17 11:00:17.000000000 +0100
+++ new/nsd-4.3.1/doc/RELNOTES  2020-04-16 10:09:33.000000000 +0200
@@ -1,5 +1,35 @@
 NSD RELEASE NOTES
 
+4.3.1
+================
+BUG FIXES:
+       - Fix #70: error: 'fd_set' undeclared.
+       - Fix #71: error: 'for' loop initial declaration used outside C99
+         mode.
+       - Fix to move declarations out of for loops in event test too.
+       - Fix #76: cpuid typedef for Hurd, DragonflyBSD compile.
+       - Fix #75: configure test for sched_setaffinity, and use
+         cpuset_setaffinity otherwise.  Also test for presence of sysconf.
+       - Fix #74: GNU Hurd fix cast from pointer to integer of different size.
+       - Fix for #74, #75: cpuset test for header contents and provide code.
+       - Fix #78: Fix SO_SETFIB error on FreeBSD.
+       - Merge PR #83 from noloader: Fix GNU HURD sched_setaffinity compile.
+       - Fix #80: NetBSD and implicit declaration of reallocarray.
+       - Fix unknown u_long in util.c for Issue #80 .
+       - Merge PR #86 from noloader: Use precious variables for GREP, EGREP,
+         SED, AWK, LEX and YACC.
+       - For PR #86: Fix that programs loaded after CFLAGS and stuff is
+         set, specifically the compiler, so that it can work if it needs
+         special flags from that.  Fix that lex only needs to support -i
+         if actually defined, otherwise the output included in the source
+         tarball can be used.
+       - Merge PR #90 by phicoh: O_CLOEXEC should be FD_CLOEXEC.
+       - Merge PR #92 by tonysgi: Fix typo.
+       - Merge PR #91 by gearnode: nsd-control-setup recreate certificates.
+         The '-r' option recreates certificates.  Without it it creates them
+         if they do not exist, and does not modify them otherwise.
+
+
 4.3.0
 ================
 FEATURES:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/nsd-4.3.0/nsd-checkconf.8.in new/nsd-4.3.1/nsd-checkconf.8.in
--- old/nsd-4.3.0/nsd-checkconf.8.in    2020-03-17 11:00:18.000000000 +0100
+++ new/nsd-4.3.1/nsd-checkconf.8.in    2020-04-16 10:09:34.000000000 +0200
@@ -1,4 +1,4 @@
-.TH "nsd\-checkconf" "8" "Mar 17, 2020" "NLnet Labs" "nsd 4.3.0"
+.TH "nsd\-checkconf" "8" "Apr 16, 2020" "NLnet Labs" "nsd 4.3.1"
 .\" Copyright (c) 2001\-2008, NLnet Labs. All rights reserved.
 .\" See LICENSE for the license.
 .SH "NAME"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/nsd-4.3.0/nsd-checkzone.8.in new/nsd-4.3.1/nsd-checkzone.8.in
--- old/nsd-4.3.0/nsd-checkzone.8.in    2020-03-17 11:00:18.000000000 +0100
+++ new/nsd-4.3.1/nsd-checkzone.8.in    2020-04-16 10:09:34.000000000 +0200
@@ -1,4 +1,4 @@
-.TH "nsd\-checkzone" "8" "Mar 17, 2020" "NLnet Labs" "nsd 4.3.0"
+.TH "nsd\-checkzone" "8" "Apr 16, 2020" "NLnet Labs" "nsd 4.3.1"
 .\" Copyright (c) 2014, NLnet Labs. All rights reserved.
 .\" See LICENSE for the license.
 .SH "NAME"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/nsd-4.3.0/nsd-control-setup.sh.in new/nsd-4.3.1/nsd-control-setup.sh.in
--- old/nsd-4.3.0/nsd-control-setup.sh.in       2020-03-17 11:00:17.000000000 
+0100
+++ new/nsd-4.3.1/nsd-control-setup.sh.in       2020-04-16 10:09:33.000000000 
+0200
@@ -5,22 +5,22 @@
 # Copyright (c) 2011, NLnet Labs. All rights reserved.
 #
 # This software is open source.
-# 
+#
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions
 # are met:
-# 
+#
 # Redistributions of source code must retain the above copyright notice,
 # this list of conditions and the following disclaimer.
-# 
+#
 # Redistributions in binary form must reproduce the above copyright notice,
 # this list of conditions and the following disclaimer in the documentation
 # and/or other materials provided with the distribution.
-# 
+#
 # Neither the name of the NLNET LABS nor the names of its contributors may
 # be used to endorse or promote products derived from this software without
 # specific prior written permission.
-# 
+#
 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -57,56 +57,71 @@
 # base name for nsd-control keys
 CTL_BASE=nsd_control
 
+# flag to recreate generated certificates
+RECREATE=0
+
 # we want -rw-r--- access (say you run this as root: grp=yes (server), all=no).
 umask 0026
 
 # end of options
 
-# functions:
-error ( ) {
-       echo "$0 fatal error: $1"
-       exit 1
+set -eu
+
+cleanup() {
+    echo "removing artifacts"
+
+    rm -rf \
+       server.cnf \
+       client.cnf \
+       "${SVR_BASE}_trust.pem" \
+       "${CTL_BASE}_trust.pem" \
+       "${SVR_BASE}_trust.srl"
+}
+
+fatal() {
+    printf "fatal error: $*\n" >/dev/stderr
+    exit 1
 }
 
-# check arguments:
-while test $# -ne 0; do
-       case $1 in
-       -d)
-       if test $# -eq 1; then error "need argument for -d"; fi
-       DESTDIR="$2"
-       shift
-       ;;
-       *)
-       echo "nsd-control-setup.sh - setup SSL keys for nsd-control"
-       echo "  -d dir  use directory to store keys and certificates."
-       echo "          default: $DESTDIR"
-       exit 1
-       ;;
-       esac
-       shift
+usage() {
+    cat <<EOF
+usage: $0 OPTIONS
+
+OPTIONS
+
+-d <dir>  used directory to store keys and certificates (default: $DESTDIR)
+-h        show help notice
+-r        recreate certificates
+EOF
+}
+
+OPTIND=1
+while getopts 'd:hr' arg; do
+    case "$arg" in
+      d) DESTDIR="$OPTARG" ;;
+      h) usage; exit 0 ;;
+      r) RECREATE=1 ;;
+      ?) fatal "'$arg' unknown option" ;;
+    esac
 done
+shift $((OPTIND - 1))
+
 
-# go!:
 echo "setup in directory $DESTDIR"
-cd "$DESTDIR" || error "could not cd to $DESTDIR"
+cd "$DESTDIR"
 
-# create certificate keys; do not recreate if they already exist.
-if test -f $SVR_BASE.key; then
-       echo "$SVR_BASE.key exists"
-else
-       echo "generating $SVR_BASE.key"
-       openssl genrsa -out $SVR_BASE.key $BITS || error "could not genrsa"
-fi
-if test -f $CTL_BASE.key; then
-       echo "$CTL_BASE.key exists"
-else
-       echo "generating $CTL_BASE.key"
-       openssl genrsa -out $CTL_BASE.key $BITS || error "could not genrsa"
+trap cleanup SIGINT
+
+# ===
+# Generate server certificate
+# ===
+
+# generate private key; do no recreate it if they already exist.
+if [ ! -f "$SVR_BASE.key" ]; then
+    openssl genrsa -out "$SVR_BASE.key" "$BITS"
 fi
 
-# create self-signed cert for server
-cat >request.cfg <<EOF
-[req]
+cat >server.cnf <<EOF
 default_bits=$BITS
 default_md=$HASH
 prompt=no
@@ -115,15 +130,30 @@
 [req_distinguished_name]
 commonName=$SERVERNAME
 EOF
-test -f request.cfg || error "could not create request.cfg"
 
-echo "create $SVR_BASE.pem (self signed certificate)"
-openssl req -key $SVR_BASE.key -config request.cfg  -new -x509 -days $DAYS 
-out $SVR_BASE.pem || error "could not create $SVR_BASE.pem"
-# create trusted usage pem
-openssl x509 -in $SVR_BASE.pem -addtrust serverAuth -out $SVR_BASE"_trust.pem"
+[ -f server.cnf ] || fatal "cannot create openssl configuration"
+
+if [ ! -f "$SVR_BASE.pem" -o $RECREATE -eq 1 ]; then
+    openssl req \
+            -new -x509 \
+            -key "$SVR_BASE.key" \
+            -config server.cnf  \
+            -days "$DAYS" \
+            -out "$SVR_BASE.pem"
 
-# create client request and sign it, piped
-cat >request.cfg <<EOF
+    [ ! -f "SVR_BASE.pem" ] || fatal "cannot create server certificate"
+fi
+
+# ===
+# Generate client certificate
+# ===
+
+# generate private key; do no recreate it if they already exist.
+if [ ! -f "$CTL_BASE.key" ]; then
+    openssl genrsa -out "$CTL_BASE.key" "$BITS"
+fi
+
+cat >client.cnf <<EOF
 [req]
 default_bits=$BITS
 default_md=$HASH
@@ -133,11 +163,43 @@
 [req_distinguished_name]
 commonName=$CLIENTNAME
 EOF
-test -f request.cfg || error "could not create request.cfg"
 
-echo "create $CTL_BASE.pem (signed client certificate)"
-openssl req -key $CTL_BASE.key -config request.cfg -new | openssl x509 -req 
-days $DAYS -CA $SVR_BASE"_trust.pem" -CAkey $SVR_BASE.key -CAcreateserial 
-$HASH -out $CTL_BASE.pem
-test -f $CTL_BASE.pem || error "could not create $CTL_BASE.pem"
+[ -f client.cnf ] || fatal "cannot create openssl configuration"
+
+if [ ! -f "$CTL_BASE.pem" -o $RECREATE -eq 1 ]; then
+    openssl x509 \
+        -addtrust serverAuth \
+        -in "$SVR_BASE.pem" \
+        -out "${SVR_BASE}_trust.pem"
+
+    openssl req \
+            -new \
+            -config client.cnf \
+            -key "$CTL_BASE.key" \
+        | openssl x509 \
+                  -req \
+                  -days "$DAYS" \
+                  -CA "${SVR_BASE}_trust.pem" \
+                  -CAkey "$SVR_BASE.key" \
+                  -CAcreateserial \
+                  -$HASH \
+                  -out "$CTL_BASE.pem"
+
+    [ ! -f "CTL_BASE.pem" ] || fatal "cannot create signed client certificate"
+fi
+
+# remove unused permissions
+chmod o-rw \
+      "$SVR_BASE.pem" \
+      "$SVR_BASE.key" \
+      "$CTL_BASE.pem" \
+      "$CTL_BASE.key"
+
+cleanup
+
+echo "Setup success. Certificates created. Enable in nsd.conf file to use"
+
+
 # create trusted usage pem
 # openssl x509 -in $CTL_BASE.pem -addtrust clientAuth -out 
$CTL_BASE"_trust.pem"
 
@@ -147,14 +209,3 @@
 # echo "preferences - advanced - encryption - view certificates - your certs"
 # echo "empty password is used, simply click OK on the password dialog box."
 # openssl pkcs12 -export -in $CTL_BASE"_trust.pem" -inkey $CTL_BASE.key -name 
"nsd remote control client cert" -out $CTL_BASE"_browser.pfx" -password "pass:" 
|| error "could not create browser certificate"
-
-# remove unused permissions
-chmod o-rw $SVR_BASE.pem $SVR_BASE.key $CTL_BASE.pem $CTL_BASE.key
-
-# remove crap
-rm -f request.cfg
-rm -f $CTL_BASE"_trust.pem" $SVR_BASE"_trust.pem" $SVR_BASE"_trust.srl"
-
-echo "Setup success. Certificates created. Enable in nsd.conf file to use"
-
-exit 0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/nsd-4.3.0/nsd-control.8.in new/nsd-4.3.1/nsd-control.8.in
--- old/nsd-4.3.0/nsd-control.8.in      2020-03-17 11:00:18.000000000 +0100
+++ new/nsd-4.3.1/nsd-control.8.in      2020-04-16 10:09:34.000000000 +0200
@@ -1,4 +1,4 @@
-.TH "nsd\-control" "8" "Mar 17, 2020" "NLnet Labs" "nsd 4.3.0"
+.TH "nsd\-control" "8" "Apr 16, 2020" "NLnet Labs" "nsd 4.3.1"
 .\" Copyright (c) 2011, NLnet Labs. All rights reserved.
 .\" See LICENSE for the license.
 .SH "NAME"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/nsd-4.3.0/nsd.8.in new/nsd-4.3.1/nsd.8.in
--- old/nsd-4.3.0/nsd.8.in      2020-03-17 11:00:18.000000000 +0100
+++ new/nsd-4.3.1/nsd.8.in      2020-04-16 10:09:34.000000000 +0200
@@ -1,9 +1,9 @@
-.TH "NSD" "8" "Mar 17, 2020" "NLnet Labs" "NSD 4.3.0"
+.TH "NSD" "8" "Apr 16, 2020" "NLnet Labs" "NSD 4.3.1"
 .\" Copyright (c) 2001\-2008, NLnet Labs. All rights reserved.
 .\" See LICENSE for the license.
 .SH "NAME"
 .B nsd
-\- Name Server Daemon (NSD) version 4.3.0.
+\- Name Server Daemon (NSD) version 4.3.1.
 .SH "SYNOPSIS"
 .B nsd
 .RB [ \-4 ] 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/nsd-4.3.0/nsd.c new/nsd-4.3.1/nsd.c
--- old/nsd-4.3.0/nsd.c 2020-03-17 11:00:17.000000000 +0100
+++ new/nsd-4.3.1/nsd.c 2020-04-16 10:09:33.000000000 +0200
@@ -142,6 +142,7 @@
        char service_buf[6 + 1 /* '\0' */]; /* 65535 */
        struct addrinfo *addr = NULL;
 
+       sock->fib = -1;
        if(node) {
                host = host_buf;
                sep = strchr(node, '@');
@@ -279,9 +280,11 @@
                   (r = getaddrinfo(NULL, tcp_port, &ai[1], &addrs[1])) == 0)
                {
                        (*udp)[i].flags |= NSD_SOCKET_IS_OPTIONAL;
+                       (*udp)[i].fib = -1;
                        copyaddrinfo(&(*udp)[i].addr, addrs[0]);
                        figure_socket_servers(&(*udp)[i], NULL);
                        (*tcp)[i].flags |= NSD_SOCKET_IS_OPTIONAL;
+                       (*tcp)[i].fib = -1;
                        copyaddrinfo(&(*tcp)[i].addr, addrs[1]);
                        figure_socket_servers(&(*tcp)[i], NULL);
                        i++;
@@ -349,7 +352,7 @@
                size_t len;
 
                if((colon = strchr(ifa->ifa_name, ':')) != NULL) {
-                       len = (size_t)((uintmax_t)colon - 
(uintmax_t)ifa->ifa_name);
+                       len = (size_t)((uintptr_t)colon - 
(uintptr_t)ifa->ifa_name);
                } else {
                        len  = strlen(ifa->ifa_name);
                }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/nsd-4.3.0/nsd.conf.5.in new/nsd-4.3.1/nsd.conf.5.in
--- old/nsd-4.3.0/nsd.conf.5.in 2020-03-17 11:00:18.000000000 +0100
+++ new/nsd-4.3.1/nsd.conf.5.in 2020-04-16 10:09:34.000000000 +0200
@@ -1,4 +1,4 @@
-.TH "nsd.conf" "5" "Mar 17, 2020" "NLnet Labs" "nsd 4.3.0"
+.TH "nsd.conf" "5" "Apr 16, 2020" "NLnet Labs" "nsd 4.3.1"
 .\" Copyright (c) 2001\-2008, NLnet Labs. All rights reserved.
 .\" See LICENSE for the license.
 .SH "NAME"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/nsd-4.3.0/nsd.h new/nsd-4.3.1/nsd.h
--- old/nsd-4.3.0/nsd.h 2020-03-17 11:00:17.000000000 +0100
+++ new/nsd-4.3.1/nsd.h 2020-04-16 10:09:33.000000000 +0200
@@ -12,6 +12,13 @@
 
 #include <signal.h>
 #include <net/if.h>
+#ifndef IFNAMSIZ
+#  ifdef IF_NAMESIZE
+#    define IFNAMSIZ IF_NAMESIZE
+#  else
+#    define IFNAMSIZ 16
+#  endif
+#endif
 #ifdef HAVE_OPENSSL_SSL_H
 #include <openssl/ssl.h>
 #endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/nsd-4.3.0/popen3.c new/nsd-4.3.1/popen3.c
--- old/nsd-4.3.0/popen3.c      2020-03-17 11:00:17.000000000 +0100
+++ new/nsd-4.3.1/popen3.c      2020-04-16 10:09:33.000000000 +0200
@@ -1,8 +1,12 @@
+#include "config.h"
 #include <assert.h>
 #include <errno.h>
 #include <fcntl.h>
 #include <stdlib.h>
 #include <unistd.h>
+#include <string.h>
+#include <errno.h>
+#include <sys/time.h>
 
 #include "popen3.h"
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/nsd-4.3.0/remote.c new/nsd-4.3.1/remote.c
--- old/nsd-4.3.0/remote.c      2020-03-17 11:00:17.000000000 +0100
+++ new/nsd-4.3.1/remote.c      2020-04-16 10:09:33.000000000 +0200
@@ -1345,7 +1345,7 @@
        }
 
        /* see if zone is a duplicate */
-       if( (zopt=zone_options_find(xfrd->nsd->options, dname)) ) {
+       if( zone_options_find(xfrd->nsd->options, dname) ) {
                region_recycle(xfrd->region, (void*)dname,
                        dname_total_size(dname));
                (void)ssl_printf(ssl, "zone %s already exists\n", arg);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/nsd-4.3.0/server.c new/nsd-4.3.1/server.c
--- old/nsd-4.3.0/server.c      2020-03-17 11:00:17.000000000 +0100
+++ new/nsd-4.3.1/server.c      2020-04-16 10:09:33.000000000 +0200
@@ -673,7 +673,7 @@
 {
        assert(sock != NULL);
 
-       if(fcntl(sock->s, F_SETFD, O_CLOEXEC) == -1) {
+       if(fcntl(sock->s, F_SETFD, FD_CLOEXEC) == -1) {
                const char *socktype =
                        sock->addr.ai_family == SOCK_DGRAM ? "udp" : "tcp";
                log_msg(LOG_ERR, "fcntl(..., O_CLOEXEC) failed for %s: %s",
@@ -1104,7 +1104,7 @@
 {
 #if defined(SO_SETFIB)
        if(setsockopt(sock->s, SOL_SOCKET, SO_SETFIB,
-                     (const void *)(uintptr_t)sock->fib, sizeof(sock->fib)) == 
-1)
+                     (const void *)&sock->fib, sizeof(sock->fib)) == -1)
        {
                log_msg(LOG_ERR, "setsockopt(..., %s, %d, ...) failed: %s",
                                 "SO_SETFIB", sock->fib, strerror(errno));
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/nsd-4.3.0/udbradtree.c new/nsd-4.3.1/udbradtree.c
--- old/nsd-4.3.0/udbradtree.c  2020-03-17 11:00:17.000000000 +0100
+++ new/nsd-4.3.1/udbradtree.c  2020-04-16 10:09:34.000000000 +0200
@@ -1257,7 +1257,7 @@
                        /* must match additional string */
                        if(pos+lookup_len(&n, byte) > len) {
                                /* the additional string is longer than key*/
-                               if( (r=memcmp(&k[pos], lookup_string(&n, byte),
+                               if( (memcmp(&k[pos], lookup_string(&n, byte),
                                        len-pos)) <= 0) {
                                        /* and the key is before this node */
                                        udb_ptr_set_rptr(result, udb,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/nsd-4.3.0/util.c new/nsd-4.3.1/util.c
--- old/nsd-4.3.0/util.c        2020-03-17 11:00:17.000000000 +0100
+++ new/nsd-4.3.1/util.c        2020-04-16 10:09:34.000000000 +0200
@@ -16,6 +16,12 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#ifdef HAVE_SCHED_H
+#include <sched.h>
+#endif /* HAVE_SCHED_H */
+#ifdef HAVE_SYS_CPUSET_H
+#include <sys/cpuset.h>
+#endif /* HAVE_SYS_CPUSET_H */
 #ifdef HAVE_SYSLOG_H
 #include <syslog.h>
 #endif /* HAVE_SYSLOG_H */
@@ -263,9 +269,9 @@
 
 void *
 xmallocarray(size_t num, size_t size)
-{  
+{
         void *result = reallocarray(NULL, num, size);
-   
+
         if (!result) {
                 log_msg(LOG_ERR, "reallocarray failed: %s", strerror(errno));
                 exit(1);
@@ -834,7 +840,7 @@
    http://www.tsfr.org/~orc/Code/bsd/bsd-current/cksum/crc.c.
    or http://gobsd.com/code/freebsd/usr.bin/cksum/crc.c
    The polynomial is 0x04c11db7L. */
-static u_long crctab[] = {
+static uint32_t crctab[] = {
        0x0,
        0x04c11db7, 0x09823b6e, 0x0d4326d9, 0x130476dc, 0x17c56b6b,
        0x1a864db2, 0x1e475005, 0x2608edb8, 0x22c9f00f, 0x2f8ad6d6,
@@ -1167,20 +1173,35 @@
 }
 
 #ifdef HAVE_CPUSET_T
-#if __linux__ || __FreeBSD__
+#if defined(HAVE_SYSCONF) && defined(_SC_NPROCESSORS_CONF)
+/* exists on Linux and FreeBSD */
 int number_of_cpus(void)
 {
        return (int)sysconf(_SC_NPROCESSORS_CONF);
 }
+#else
+int number_of_cpus(void)
+{
+       return -1;
+}
 #endif
-#if __linux__
+#ifdef __gnu_hurd__
+/* HURD has no sched_setaffinity implementation, but links an always fail,
+ * with a linker error, we print an error when it is used */
+int set_cpu_affinity(cpuset_t *ATTR_UNUSED(set))
+{
+       log_err("sched_setaffinity: not available on this system");
+       return -1;
+}
+#elif defined(HAVE_SCHED_SETAFFINITY)
+/* Linux */
 int set_cpu_affinity(cpuset_t *set)
 {
        assert(set != NULL);
        return sched_setaffinity(getpid(), sizeof(*set), set);
 }
-#endif
-#if __FreeBSD__
+#else
+/* FreeBSD */
 int set_cpu_affinity(cpuset_t *set)
 {
        assert(set != NULL);



Reply via email to