summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorStuart Henderson <sthen@cvs.openbsd.org>2020-10-13 10:05:09 +0000
committerStuart Henderson <sthen@cvs.openbsd.org>2020-10-13 10:05:09 +0000
commiteb26bf7266d625f593c5713fa50667f57a8f5b31 (patch)
tree2a9d29864f0fa28dd983b8e66055ff0899b45a1c /usr.sbin
parenta581dcc7238051ac9271dc296140284deb7786cf (diff)
import NSD 4.3.3, ok florian@
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/nsd/.cirrus.yml139
-rw-r--r--usr.sbin/nsd/.github/FUNDING.yml2
-rw-r--r--usr.sbin/nsd/tsig-openssl.h2
3 files changed, 142 insertions, 1 deletions
diff --git a/usr.sbin/nsd/.cirrus.yml b/usr.sbin/nsd/.cirrus.yml
new file mode 100644
index 00000000000..026e2b4b170
--- /dev/null
+++ b/usr.sbin/nsd/.cirrus.yml
@@ -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:=spam@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 --git a/usr.sbin/nsd/.github/FUNDING.yml b/usr.sbin/nsd/.github/FUNDING.yml
new file mode 100644
index 00000000000..2a357c0c777
--- /dev/null
+++ b/usr.sbin/nsd/.github/FUNDING.yml
@@ -0,0 +1,2 @@
+github: [NLnetLabs]
+custom: ['https://nlnetlabs.nl/funding/']
diff --git a/usr.sbin/nsd/tsig-openssl.h b/usr.sbin/nsd/tsig-openssl.h
index 859c280c4c0..c3c9b2359c8 100644
--- a/usr.sbin/nsd/tsig-openssl.h
+++ b/usr.sbin/nsd/tsig-openssl.h
@@ -22,7 +22,7 @@
*/
int tsig_openssl_init(region_type *region);
-void tsig_openssl_finalize();
+void tsig_openssl_finalize(void);
#endif /* defined(HAVE_SSL) */