pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/net/bind918



Module Name:    pkgsrc
Committed By:   sekiya
Date:           Sun Dec 11 01:57:55 UTC 2022

Added Files:
        pkgsrc/net/bind918: DESCR MESSAGE.rcd Makefile PLIST buildlink3.mk
            builtin.mk distinfo options.mk
        pkgsrc/net/bind918/patches: patch-bin_named_main.c patch-bin_named_os.c
            patch-bin_named_server.c patch-config.h.in patch-configure.ac
            patch-lib_dns_byaddr.c patch-lib_dns_gssapi__link.c
            patch-lib_dns_include_dns_zone.h patch-lib_dns_lookup.c
            patch-lib_dns_rbtdb.c patch-lib_dns_request.c patch-lib_dns_sdb.c
            patch-lib_dns_sdlz.c patch-lib_dns_validator.c patch-lib_dns_view.c
            patch-lib_dns_zone.c patch-lib_isc_app.c
            patch-lib_isc_include_isc_netmgr.h patch-lib_isc_net.c
            patch-lib_isc_netmgr_netmgr-int.h patch-lib_isc_netmgr_netmgr.c
            patch-lib_isc_rwlock.c patch-lib_isc_siphash.c patch-lib_isc_time.c
            patch-lib_isc_timer.c patch-lib_ns_Makefile.am
            patch-lib_ns_client.c patch-lib_ns_include_ns_pfilter.h
            patch-lib_ns_pfilter.c patch-lib_ns_query.c patch-lib_ns_update.c
            patch-lib_ns_xfrout.c

Log Message:
Add net/bind918


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 pkgsrc/net/bind918/DESCR \
    pkgsrc/net/bind918/MESSAGE.rcd pkgsrc/net/bind918/Makefile \
    pkgsrc/net/bind918/PLIST pkgsrc/net/bind918/buildlink3.mk \
    pkgsrc/net/bind918/builtin.mk pkgsrc/net/bind918/distinfo \
    pkgsrc/net/bind918/options.mk
cvs rdiff -u -r0 -r1.1 pkgsrc/net/bind918/patches/patch-bin_named_main.c \
    pkgsrc/net/bind918/patches/patch-bin_named_os.c \
    pkgsrc/net/bind918/patches/patch-bin_named_server.c \
    pkgsrc/net/bind918/patches/patch-config.h.in \
    pkgsrc/net/bind918/patches/patch-configure.ac \
    pkgsrc/net/bind918/patches/patch-lib_dns_byaddr.c \
    pkgsrc/net/bind918/patches/patch-lib_dns_gssapi__link.c \
    pkgsrc/net/bind918/patches/patch-lib_dns_include_dns_zone.h \
    pkgsrc/net/bind918/patches/patch-lib_dns_lookup.c \
    pkgsrc/net/bind918/patches/patch-lib_dns_rbtdb.c \
    pkgsrc/net/bind918/patches/patch-lib_dns_request.c \
    pkgsrc/net/bind918/patches/patch-lib_dns_sdb.c \
    pkgsrc/net/bind918/patches/patch-lib_dns_sdlz.c \
    pkgsrc/net/bind918/patches/patch-lib_dns_validator.c \
    pkgsrc/net/bind918/patches/patch-lib_dns_view.c \
    pkgsrc/net/bind918/patches/patch-lib_dns_zone.c \
    pkgsrc/net/bind918/patches/patch-lib_isc_app.c \
    pkgsrc/net/bind918/patches/patch-lib_isc_include_isc_netmgr.h \
    pkgsrc/net/bind918/patches/patch-lib_isc_net.c \
    pkgsrc/net/bind918/patches/patch-lib_isc_netmgr_netmgr-int.h \
    pkgsrc/net/bind918/patches/patch-lib_isc_netmgr_netmgr.c \
    pkgsrc/net/bind918/patches/patch-lib_isc_rwlock.c \
    pkgsrc/net/bind918/patches/patch-lib_isc_siphash.c \
    pkgsrc/net/bind918/patches/patch-lib_isc_time.c \
    pkgsrc/net/bind918/patches/patch-lib_isc_timer.c \
    pkgsrc/net/bind918/patches/patch-lib_ns_Makefile.am \
    pkgsrc/net/bind918/patches/patch-lib_ns_client.c \
    pkgsrc/net/bind918/patches/patch-lib_ns_include_ns_pfilter.h \
    pkgsrc/net/bind918/patches/patch-lib_ns_pfilter.c \
    pkgsrc/net/bind918/patches/patch-lib_ns_query.c \
    pkgsrc/net/bind918/patches/patch-lib_ns_update.c \
    pkgsrc/net/bind918/patches/patch-lib_ns_xfrout.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Added files:

Index: pkgsrc/net/bind918/DESCR
diff -u /dev/null pkgsrc/net/bind918/DESCR:1.1
--- /dev/null   Sun Dec 11 01:57:55 2022
+++ pkgsrc/net/bind918/DESCR    Sun Dec 11 01:57:55 2022
@@ -0,0 +1,4 @@
+BIND, the Berkeley Internet Name Daemon.  This package contains the BIND
+9.18 release.
+
+Release notes are at https://bind9.readthedocs.io/en/v9_18_0/notes.html
Index: pkgsrc/net/bind918/MESSAGE.rcd
diff -u /dev/null pkgsrc/net/bind918/MESSAGE.rcd:1.1
--- /dev/null   Sun Dec 11 01:57:55 2022
+++ pkgsrc/net/bind918/MESSAGE.rcd      Sun Dec 11 01:57:55 2022
@@ -0,0 +1,19 @@
+===========================================================================
+$NetBSD: MESSAGE.rcd,v 1.1 2022/12/11 01:57:55 sekiya Exp $
+
+Please consider running BIND under the pseudo user account "${BIND_USER}"
+in a chroot environment for security reasons.
+
+To achieve this, set the variable "named_chrootdir" in /etc/rc.conf to
+the directory with the chroot environment e.g. "${BIND_DIR}".
+
+Note: named(8) requires writable directories under "/etc/namedb" which
+specified by "directory" in "options" statement:
+
+       cache
+       keys
+       nta
+
+Make sure to these directories exists with writable by "${BIND_USER}" user.
+
+===========================================================================
Index: pkgsrc/net/bind918/Makefile
diff -u /dev/null pkgsrc/net/bind918/Makefile:1.1
--- /dev/null   Sun Dec 11 01:57:55 2022
+++ pkgsrc/net/bind918/Makefile Sun Dec 11 01:57:55 2022
@@ -0,0 +1,89 @@
+# $NetBSD: Makefile,v 1.1 2022/12/11 01:57:55 sekiya Exp $
+
+DISTNAME=      bind-${BIND_VERSION}
+#PKGNAME=      bind-9.18
+PKGNAME=       ${DISTNAME:S/-P/pl/}
+#PKGREVISION=  1
+CATEGORIES=    net
+MASTER_SITES=  ftp://ftp.isc.org/isc/bind9/${BIND_VERSION}/
+EXTRACT_SUFX=  .tar.xz
+
+MAINTAINER=    sekiya%NetBSD.org@localhost
+HOMEPAGE=      https://www.isc.org/software/bind/
+COMMENT=       Berkeley Internet Name Daemon implementation of DNS, version 9.18
+LICENSE=       mpl-2.0
+
+CONFLICTS+=    host-[0-9]*
+
+MAKE_JOBS_SAFE=        no
+
+BIND_VERSION=  9.18.9
+
+BUILD_DEFS+=   BIND_DIR VARBASE
+
+.include "options.mk"
+
+USE_TOOLS+=            aclocal autoconf automake pax perl pkg-config
+USE_LIBTOOL=           yes
+GNU_CONFIGURE=         yes
+CHECK_FILES_SKIP=      bin/tests/system/system-test-driver.sh
+MAKE_ENV+=             WRKDIR=${WRKDIR} PREFIX=${PREFIX}
+
+.if ${OPSYS} == "Linux" && !exists(/usr/include/sys/capability.h)
+CONFIGURE_ARGS+=               --disable-linux-caps
+.endif
+
+CONFIGURE_ARGS+=               --sysconfdir=${PKG_SYSCONFDIR}
+CONFIGURE_ARGS+=               --localstatedir=${VARBASE}
+CONFIGURE_ARGS+=               --with-openssl=${SSLBASE:Q}
+CONFIGURE_ARGS.DragonFly+=     --disable-kqueue
+CONFIGURE_ARGS.SunOS+=         --disable-epoll
+
+BUILDLINK_TRANSFORM.SunOS+=    rm:-zrelax=transtls
+
+PKG_GROUPS_VARS+=      BIND_GROUP
+PKG_USERS_VARS=                BIND_USER
+
+PKG_GROUPS=            ${BIND_GROUP}
+PKG_USERS=             ${BIND_USER}:${BIND_GROUP}
+
+PKG_GECOS.${BIND_USER}=        Named pseudo-user
+PKG_HOME.${BIND_USER}= ${BIND_DIR}
+
+DOCS=                  CHANGES OPTIONS.md README.md
+
+FILES_SUBST+=          BIND_GROUP=${BIND_GROUP} \
+                       BIND_USER=${BIND_USER} PAX=${PAX:Q} \
+                       SSLBASE=${SSLBASE}
+MESSAGE_SUBST+=                BIND_DIR=${BIND_DIR} BIND_USER=${BIND_USER}
+
+DOCDIR=                        share/doc/bind9
+
+RCD_SCRIPTS=           named9
+SMF_METHODS=           named
+
+INSTALL_MAKE_FLAGS+=   sysconfdir=${PREFIX}/share/examples/bind9
+CONF_FILES+=           share/examples/bind9/bind.keys \
+                       ${PKG_SYSCONFDIR}/bind.keys
+
+INSTALLATION_DIRS+=    ${DOCDIR}
+
+pre-configure:
+       cd ${WRKSRC} && \
+       rm -rf autom4te*.cache && \
+       aclocal && \
+       automake --include-deps --add-missing --copy && \
+       autoconf -f
+
+post-install:
+.for f in ${DOCS}
+       ${INSTALL_DATA} ${WRKSRC}/${f} ${DESTDIR}${PREFIX}/${DOCDIR}
+.endfor
+
+.include "../../mk/atomic64.mk"
+.include "../../lang/python310/buildlink3.mk"
+.include "../../www/nghttp2/buildlink3.mk"
+.include "../../security/openssl/buildlink3.mk"
+.include "../../devel/libuv/buildlink3.mk"
+.include "../../devel/zlib/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
Index: pkgsrc/net/bind918/PLIST
diff -u /dev/null pkgsrc/net/bind918/PLIST:1.1
--- /dev/null   Sun Dec 11 01:57:55 2022
+++ pkgsrc/net/bind918/PLIST    Sun Dec 11 01:57:55 2022
@@ -0,0 +1,312 @@
+@comment $NetBSD: PLIST,v 1.1 2022/12/11 01:57:55 sekiya Exp $
+bin/arpaname
+bin/delv
+bin/dig
+bin/dnssec-cds
+bin/dnssec-dsfromkey
+bin/dnssec-importkey
+bin/dnssec-keyfromlabel
+bin/dnssec-keygen
+bin/dnssec-revoke
+bin/dnssec-settime
+bin/dnssec-signzone
+bin/dnssec-verify
+${PLIST.dnstap}bin/dnstap-read
+bin/host
+bin/mdig
+bin/named-checkconf
+bin/named-checkzone
+bin/named-compilezone
+bin/named-journalprint
+${PLIST.lmdb}bin/named-nzd2nzf
+bin/named-rrchecker
+bin/nsec3hash
+bin/nslookup
+bin/nsupdate
+include/bind9/check.h
+include/bind9/getaddresses.h
+include/dns/acl.h
+include/dns/adb.h
+include/dns/badcache.h
+include/dns/bit.h
+include/dns/byaddr.h
+include/dns/cache.h
+include/dns/callbacks.h
+include/dns/catz.h
+include/dns/cert.h
+include/dns/client.h
+include/dns/clientinfo.h
+include/dns/compress.h
+include/dns/db.h
+include/dns/dbiterator.h
+include/dns/diff.h
+include/dns/dispatch.h
+include/dns/dlz.h
+include/dns/dlz_dlopen.h
+include/dns/dns64.h
+include/dns/dnsrps.h
+include/dns/dnssec.h
+include/dns/dnstap.h
+include/dns/ds.h
+include/dns/dsdigest.h
+include/dns/dyndb.h
+include/dns/ecs.h
+include/dns/edns.h
+include/dns/enumclass.h
+include/dns/enumtype.h
+include/dns/events.h
+include/dns/fixedname.h
+include/dns/forward.h
+include/dns/geoip.h
+include/dns/ipkeylist.h
+include/dns/iptable.h
+include/dns/journal.h
+include/dns/kasp.h
+include/dns/keydata.h
+include/dns/keyflags.h
+include/dns/keymgr.h
+include/dns/keytable.h
+include/dns/keyvalues.h
+include/dns/librpz.h
+include/dns/log.h
+include/dns/lookup.h
+include/dns/master.h
+include/dns/masterdump.h
+include/dns/message.h
+include/dns/name.h
+include/dns/ncache.h
+include/dns/nsec.h
+include/dns/nsec3.h
+include/dns/nta.h
+include/dns/opcode.h
+include/dns/order.h
+include/dns/peer.h
+include/dns/private.h
+include/dns/rbt.h
+include/dns/rcode.h
+include/dns/rdata.h
+include/dns/rdataclass.h
+include/dns/rdatalist.h
+include/dns/rdataset.h
+include/dns/rdatasetiter.h
+include/dns/rdataslab.h
+include/dns/rdatastruct.h
+include/dns/rdatatype.h
+include/dns/request.h
+include/dns/resolver.h
+include/dns/result.h
+include/dns/rootns.h
+include/dns/rpz.h
+include/dns/rriterator.h
+include/dns/rrl.h
+include/dns/sdb.h
+include/dns/sdlz.h
+include/dns/secalg.h
+include/dns/secproto.h
+include/dns/soa.h
+include/dns/ssu.h
+include/dns/stats.h
+include/dns/time.h
+include/dns/tkey.h
+include/dns/transport.h
+include/dns/tsec.h
+include/dns/tsig.h
+include/dns/ttl.h
+include/dns/types.h
+include/dns/update.h
+include/dns/validator.h
+include/dns/view.h
+include/dns/xfrin.h
+include/dns/zone.h
+include/dns/zonekey.h
+include/dns/zoneverify.h
+include/dns/zt.h
+include/dst/dst.h
+include/dst/gssapi.h
+include/irs/resconf.h
+include/isc/aes.h
+include/isc/align.h
+include/isc/app.h
+include/isc/assertions.h
+include/isc/astack.h
+include/isc/atomic.h
+include/isc/attributes.h
+include/isc/backtrace.h
+include/isc/barrier.h
+include/isc/base32.h
+include/isc/base64.h
+include/isc/bind9.h
+include/isc/buffer.h
+include/isc/cmocka.h
+include/isc/commandline.h
+include/isc/condition.h
+include/isc/counter.h
+include/isc/crc64.h
+include/isc/deprecated.h
+include/isc/dir.h
+include/isc/endian.h
+include/isc/errno.h
+include/isc/error.h
+include/isc/event.h
+include/isc/eventclass.h
+include/isc/file.h
+include/isc/formatcheck.h
+include/isc/fsaccess.h
+include/isc/fuzz.h
+include/isc/glob.h
+include/isc/hash.h
+include/isc/heap.h
+include/isc/hex.h
+include/isc/hmac.h
+include/isc/ht.h
+include/isc/httpd.h
+include/isc/interfaceiter.h
+include/isc/iterated_hash.h
+include/isc/lang.h
+include/isc/lex.h
+include/isc/list.h
+include/isc/log.h
+include/isc/magic.h
+include/isc/managers.h
+include/isc/md.h
+include/isc/mem.h
+include/isc/meminfo.h
+include/isc/mutex.h
+include/isc/mutexblock.h
+include/isc/net.h
+include/isc/netaddr.h
+include/isc/netdb.h
+include/isc/netmgr.h
+include/isc/netscope.h
+include/isc/nonce.h
+include/isc/offset.h
+include/isc/once.h
+include/isc/os.h
+include/isc/parseint.h
+include/isc/pool.h
+include/isc/portset.h
+include/isc/print.h
+include/isc/quota.h
+include/isc/radix.h
+include/isc/random.h
+include/isc/ratelimiter.h
+include/isc/refcount.h
+include/isc/regex.h
+include/isc/region.h
+include/isc/resource.h
+include/isc/result.h
+include/isc/rwlock.h
+include/isc/safe.h
+include/isc/serial.h
+include/isc/siphash.h
+include/isc/sockaddr.h
+include/isc/stat.h
+include/isc/stats.h
+include/isc/stdatomic.h
+include/isc/stdio.h
+include/isc/stdtime.h
+include/isc/strerr.h
+include/isc/string.h
+include/isc/symtab.h
+include/isc/syslog.h
+include/isc/task.h
+include/isc/taskpool.h
+include/isc/thread.h
+include/isc/time.h
+include/isc/timer.h
+include/isc/tls.h
+include/isc/tm.h
+include/isc/types.h
+include/isc/url.h
+include/isc/utf8.h
+include/isc/util.h
+include/isccc/alist.h
+include/isccc/base64.h
+include/isccc/cc.h
+include/isccc/ccmsg.h
+include/isccc/events.h
+include/isccc/sexpr.h
+include/isccc/symtab.h
+include/isccc/symtype.h
+include/isccc/types.h
+include/isccc/util.h
+include/isccfg/aclconf.h
+include/isccfg/cfg.h
+include/isccfg/duration.h
+include/isccfg/grammar.h
+include/isccfg/kaspconf.h
+include/isccfg/log.h
+include/isccfg/namedconf.h
+include/ns/client.h
+include/ns/events.h
+include/ns/hooks.h
+include/ns/interfacemgr.h
+include/ns/listenlist.h
+include/ns/log.h
+include/ns/notify.h
+include/ns/query.h
+include/ns/server.h
+include/ns/sortlist.h
+include/ns/stats.h
+include/ns/types.h
+include/ns/update.h
+include/ns/xfrout.h
+lib/bind/filter-a.la
+lib/bind/filter-aaaa.la
+lib/libbind9-9.18.9.so
+lib/libbind9.la
+lib/libdns-9.18.9.so
+lib/libdns.la
+lib/libirs-9.18.9.so
+lib/libirs.la
+lib/libisc-9.18.9.so
+lib/libisc.la
+lib/libisccc-9.18.9.so
+lib/libisccc.la
+lib/libisccfg-9.18.9.so
+lib/libisccfg.la
+lib/libns-9.18.9.so
+lib/libns.la
+man/man1/arpaname.1
+man/man1/delv.1
+man/man1/dig.1
+man/man1/dnssec-cds.1
+man/man1/dnssec-dsfromkey.1
+man/man1/dnssec-importkey.1
+man/man1/dnssec-keyfromlabel.1
+man/man1/dnssec-keygen.1
+man/man1/dnssec-revoke.1
+man/man1/dnssec-settime.1
+man/man1/dnssec-signzone.1
+man/man1/dnssec-verify.1
+${PLIST.dnstap}man/man1/dnstap-read.1
+man/man1/host.1
+man/man1/mdig.1
+man/man1/named-checkconf.1
+man/man1/named-checkzone.1
+man/man1/named-compilezone.1
+man/man1/named-journalprint.1
+${PLIST.lmdb}man/man1/named-nzd2nzf.1
+man/man1/named-rrchecker.1
+man/man1/nsec3hash.1
+man/man1/nslookup.1
+man/man1/nsupdate.1
+man/man5/named.conf.5
+man/man5/rndc.conf.5
+man/man8/ddns-confgen.8
+man/man8/filter-a.8
+man/man8/filter-aaaa.8
+man/man8/named.8
+man/man8/rndc-confgen.8
+man/man8/rndc.8
+man/man8/tsig-keygen.8
+sbin/ddns-confgen
+sbin/named
+sbin/rndc
+sbin/rndc-confgen
+sbin/tsig-keygen
+share/doc/bind9/CHANGES
+share/doc/bind9/OPTIONS.md
+share/doc/bind9/README.md
+share/examples/bind9/bind.keys
+share/examples/rc.d/named9
Index: pkgsrc/net/bind918/buildlink3.mk
diff -u /dev/null pkgsrc/net/bind918/buildlink3.mk:1.1
--- /dev/null   Sun Dec 11 01:57:55 2022
+++ pkgsrc/net/bind918/buildlink3.mk    Sun Dec 11 01:57:55 2022
@@ -0,0 +1,13 @@
+# $NetBSD: buildlink3.mk,v 1.1 2022/12/11 01:57:55 sekiya Exp $
+
+BUILDLINK_TREE+=       bind
+
+.if !defined(BIND_BUILDLINK3_MK)
+BIND_BUILDLINK3_MK:=
+
+BUILDLINK_API_DEPENDS.bind+=   bind>=9.18.0
+BUILDLINK_ABI_DEPENDS.bind?=   bind>=9.18.30nb1
+BUILDLINK_PKGSRCDIR.bind?=     ../../net/bind918
+.endif # BIND_BUILDLINK3_MK
+
+BUILDLINK_TREE+=       -bind
Index: pkgsrc/net/bind918/builtin.mk
diff -u /dev/null pkgsrc/net/bind918/builtin.mk:1.1
--- /dev/null   Sun Dec 11 01:57:55 2022
+++ pkgsrc/net/bind918/builtin.mk       Sun Dec 11 01:57:55 2022
@@ -0,0 +1,91 @@
+# $NetBSD: builtin.mk,v 1.1 2022/12/11 01:57:55 sekiya Exp $
+
+BUILTIN_PKG:=  bind
+
+BUILTIN_FIND_FILES_VAR:=       EXE_NAMED
+BUILTIN_FIND_FILES.EXE_NAMED=  /usr/sbin/named
+BUILTIN_FIND_LIBS:=            bind
+
+.include "../../mk/buildlink3/bsd.builtin.mk"
+
+###
+### Figure out the version of BIND if an ISC BIND named exists on the
+### system.
+###
+.if !defined(BUILTIN_VERSION.bind) && \
+    empty(EXE_NAMED:M__nonexistent__) && \
+    empty(EXE_NAMED:M${LOCALBASE}/*)
+BUILTIN_VERSION.bind!= \
+       ${EXE_NAMED} -v 2>/dev/null | ${HEAD} -1 |                      \
+       ${AWK} 'BEGIN { v = "4.9.11"; }                                 \
+               /^BIND / { v = $$2; sub("-.*", "", v); }                \
+               /^named / { v = $$2; sub("-.*", "", v); }               \
+               END { print v; }'
+.endif
+MAKEVARS+=     BUILTIN_VERSION.bind
+
+###
+### Determine if there is a built-in implementation of the package and
+### set IS_BUILTIN.<pkg> appropriately ("yes" or "no").
+###
+.if !defined(IS_BUILTIN.bind)
+IS_BUILTIN.bind=       no
+.  if defined(BUILTIN_VERSION.bind)
+IS_BUILTIN.bind=       yes
+.  endif
+.endif
+MAKEVARS+=             IS_BUILTIN.bind
+
+###
+### If there is a built-in implementation, then set BUILTIN_PKG.<pkg> to
+### a package name to represent the built-in package.
+###
+.if !defined(BUILTIN_PKG.bind) && \
+    ${IS_BUILTIN.bind:tl} == yes && \
+    defined(BUILTIN_VERSION.bind)
+BUILTIN_PKG.bind=      bind-${BUILTIN_VERSION.bind}
+.endif
+MAKEVARS+=             BUILTIN_PKG.bind
+
+###
+### Determine whether we should use the built-in implementation if it
+### exists, and set USE_BUILTIN.<pkg> appropriate ("yes" or "no").
+###
+.if !defined(USE_BUILTIN.bind)
+.  if ${PREFER.bind} == "pkgsrc"
+USE_BUILTIN.bind=      no
+.  else
+USE_BUILTIN.bind=      ${IS_BUILTIN.bind}
+.    if defined(BUILTIN_PKG.bind) && \
+        ${IS_BUILTIN.bind:tl} == yes
+USE_BUILTIN.bind=      yes
+.      for dep in ${BUILDLINK_API_DEPENDS.bind}
+.        if ${USE_BUILTIN.bind:tl} == yes
+USE_BUILTIN.bind!=                                                     \
+       if ${PKG_ADMIN} pmatch ${dep:Q} ${BUILTIN_PKG.bind:Q}; then     \
+               ${ECHO} yes;                                            \
+       else                                                            \
+               ${ECHO} no;                                             \
+       fi
+.        endif
+.      endfor
+.    endif
+.  endif  # PREFER.bind
+.endif
+MAKEVARS+=             USE_BUILTIN.bind
+
+###
+### The section below only applies if we are not including this file
+### solely to determine whether a built-in implementation exists.
+###
+CHECK_BUILTIN.bind?=   no
+.if ${CHECK_BUILTIN.bind:tl} == no
+.  if ${USE_BUILTIN.bind:tl} == yes
+.    if ${BUILTIN_LIB_FOUND.bind:U:tl} == yes
+BUILDLINK_LDADD.bind?= -lbind
+.    endif
+.  elif ${USE_BUILTIN.bind:tl} == no
+BUILDLINK_LDADD.bind?= -lbind
+.  endif
+
+.endif # CHECK_BUILTIN.bind
Index: pkgsrc/net/bind918/distinfo
diff -u /dev/null pkgsrc/net/bind918/distinfo:1.1
--- /dev/null   Sun Dec 11 01:57:55 2022
+++ pkgsrc/net/bind918/distinfo Sun Dec 11 01:57:55 2022
@@ -0,0 +1,37 @@
+$NetBSD: distinfo,v 1.1 2022/12/11 01:57:55 sekiya Exp $
+
+BLAKE2s (bind-9.18.9.tar.xz) = 8c3f2dcb57205959f78c02fd32a12d0897050897af9136b58972fde41468ec55
+SHA512 (bind-9.18.9.tar.xz) = 7d9bca47e29e8634416ab52819d78ce4ec6196c0dcbd9fe95a24687337f71c69b6472cf20bf49ea0ae1751a861944f354f9122acfb01780f51278ad4a3fdd817
+Size (bind-9.18.9.tar.xz) = 5281732 bytes
+SHA1 (patch-bin_named_main.c) = 4e4a763c478f1fcecb7e65968cf6ca20dacf01f1
+SHA1 (patch-bin_named_os.c) = 5ecb0883076575d8ac5fcad68f9daad6c9be0d0b
+SHA1 (patch-bin_named_server.c) = 6e59d3f637ebb829eec2f76ba7c350fb5cf9be6d
+SHA1 (patch-config.h.in) = 6072793048cdf590863046355eeffa1d93524c36
+SHA1 (patch-configure.ac) = 7eecb2c390168566b2320791cd185530c7896c21
+SHA1 (patch-lib_dns_byaddr.c) = 647ddaaaf040233e18d1a87d83bc2bd63d2a20e3
+SHA1 (patch-lib_dns_gssapi__link.c) = 72296598b0bdd2a57d0f38ecf1775e2898a041c6
+SHA1 (patch-lib_dns_include_dns_zone.h) = e6dfcd43430538ac2a39b217fcae0d81e4c4d163
+SHA1 (patch-lib_dns_lookup.c) = 6c7463aca16abf6bd578aba1733a3217608a39d3
+SHA1 (patch-lib_dns_rbtdb.c) = e8d61e1ba613b2a2fdcd3ff077e2e5b6ce2e45b2
+SHA1 (patch-lib_dns_request.c) = 4a9d0409afcf9f989aa9297efb97c578b4863d9c
+SHA1 (patch-lib_dns_sdb.c) = ed447ec7a134e620765b25ee36124a19dfd9fab0
+SHA1 (patch-lib_dns_sdlz.c) = 4fc15a577c64501c10c144eab147e54686e80309
+SHA1 (patch-lib_dns_validator.c) = 03dd60d4c38be7248d1e07f2c29ddd543b5f7454
+SHA1 (patch-lib_dns_view.c) = 5b092f0344b92d003f1fe1f28e4cc4c76b2505cf
+SHA1 (patch-lib_dns_zone.c) = cd7bc1e76caf1d664393efa318786c2b33c000de
+SHA1 (patch-lib_isc_app.c) = 8f9fd079d00d34f0d20e6d9e676446d322f9e0fb
+SHA1 (patch-lib_isc_include_isc_netmgr.h) = 48ac44c6a9b81e6b442deba6c075653d3691464b
+SHA1 (patch-lib_isc_net.c) = 743de2701fa96ef25e5689f40e381628cff641d5
+SHA1 (patch-lib_isc_netmgr_netmgr-int.h) = d84993edf254605f85421fbdd2fc523255c7316d
+SHA1 (patch-lib_isc_netmgr_netmgr.c) = 3df1d37061f6ceb37e309a0dc4f782fc35863146
+SHA1 (patch-lib_isc_rwlock.c) = 1d114248ddee20db7a7429afab446f8b2f0dca82
+SHA1 (patch-lib_isc_siphash.c) = 8999deb002e4fdb6b13e6f297298ef73c97042c3
+SHA1 (patch-lib_isc_time.c) = 04719dce1ad7328909fd584104b7bc20170b3c5e
+SHA1 (patch-lib_isc_timer.c) = aea2019bbf3d84cad77af432a2bbdf0da8f2f893
+SHA1 (patch-lib_ns_Makefile.am) = a91e1713185c4366e96bf52ebee38e3b7e35a0c6
+SHA1 (patch-lib_ns_client.c) = 4093c82254321e6c6eaa40ea1cf738b3f9bda0bb
+SHA1 (patch-lib_ns_include_ns_pfilter.h) = cc86752971b4f9f7492283c4ad3ff29bc1bae237
+SHA1 (patch-lib_ns_pfilter.c) = b0345f9b27e2bdd4f9a992cfc23616e027de4988
+SHA1 (patch-lib_ns_query.c) = d947318dc6a261931928c4bf8b7f48efa9004a38
+SHA1 (patch-lib_ns_update.c) = 2fb3457da333143508d28420490cbc1cb69ddb19
+SHA1 (patch-lib_ns_xfrout.c) = 79d9e4add58ffd75ea9718f5501f1517e67416e3
Index: pkgsrc/net/bind918/options.mk
diff -u /dev/null pkgsrc/net/bind918/options.mk:1.1
--- /dev/null   Sun Dec 11 01:57:55 2022
+++ pkgsrc/net/bind918/options.mk       Sun Dec 11 01:57:55 2022
@@ -0,0 +1,149 @@
+# $NetBSD: options.mk,v 1.1 2022/12/11 01:57:55 sekiya Exp $
+
+PKG_OPTIONS_VAR=       PKG_OPTIONS.bind
+PKG_SUPPORTED_OPTIONS= bind-dig-sigchase bind-xml-statistics-server
+PKG_SUPPORTED_OPTIONS+=        bind-json-statistics-server blacklist blocklist
+PKG_SUPPORTED_OPTIONS+=        threads readline lmdb mysql pgsql ldap dlz-filesystem
+PKG_SUPPORTED_OPTIONS+=        geoip tuning dnstap
+PKG_SUGGESTED_OPTIONS+=        readline
+
+PLIST_VARS+=   dnstap lmdb
+
+PTHREAD_OPTS+=         native
+.include "../../mk/pthread.buildlink3.mk"
+
+.if defined(PTHREAD_TYPE) && (${PTHREAD_TYPE} == "none") || \
+       !empty(MACHINE_PLATFORM:MNetBSD-*-vax) || \
+       !empty(MACHINE_PLATFORM:MNetBSD-*-sparc) || \
+       !empty(MACHINE_PLATFORM:MNetBSD-*-sparc64) || \
+       !empty(MACHINE_PLATFORM:MNetBSD-*-m68k)
+# don't touch PKG_SUGGESTED_OPTIONS
+.else
+PKG_SUGGESTED_OPTIONS+=        threads
+.endif
+
+.if ${OPSYS} == "NetBSD"
+.  if !empty(PKG_OPTIONS:Mblacklist)
+.    if exists(/usr/include/blacklist.h)
+PKG_SUGGESTED_OPTIONS+=        blacklist
+.    elif !empty(PKG_OPTIONS:Mblocklist) && exists(/usr/include/blocklist.h)
+PKG_SUGGESTED_OPTIONS+=        blocklist
+.    endif
+.  endif
+.endif
+
+.include "../../mk/bsd.options.mk"
+
+###
+### The mysql pgsql ldap dlz-filesystem options are all for BIND
+### DLZ (Dynamically Loadable Zones) functionality
+###
+### NOTE: bdb is excluded on purpose as pkgsrc does not contain
+###       a bdb v4.1 or 4.2 package which is what BIND needs.
+###       The majority of these are compile tested only
+###
+
+.if !empty(PKG_OPTIONS:Mlmdb)
+.include "../../databases/lmdb/buildlink3.mk"
+CONFIGURE_ARGS+=       --with-lmdb=${PREFIX}
+PLIST.lmdb=            yes
+.else
+CONFIGURE_ARGS+=       --with-lmdb=no
+.endif
+
+.if !empty(PKG_OPTIONS:Mmysql)
+.include "../../mk/mysql.buildlink3.mk"
+CONFIGURE_ARGS+=       --with-dlz-mysql=${BUILDLINK_PREFIX.mysql-client}
+.endif
+
+.if !empty(PKG_OPTIONS:Mpgsql)
+.include "../../mk/pgsql.buildlink3.mk"
+CONFIGURE_ARGS+=       --with-dlz-postgres=${BUILDLINK_PREFIX.${PGSQL_TYPE}}
+CONFIGURE_ENV+=                ac_cv_path_PG_CONFIG=${PREFIX}/bin/pg_config
+.endif
+
+.if !empty(PKG_OPTIONS:Mldap)
+.include "../../databases/openldap-client/buildlink3.mk"
+CONFIGURE_ARGS+=       --with-dlz-ldap=${BUILDLINK_PREFIX.openldap-client}
+.endif
+
+.if !empty(PKG_OPTIONS:Mdlz-filesystem)
+CONFIGURE_ARGS+=       --with-dlz-filesystem
+.endif
+
+.if !empty(PKG_OPTIONS:Mblacklist)
+CONFIGURE_ARGS+=       --with-blacklist=yes
+.else
+CONFIGURE_ARGS+=       --with-blacklist=no
+.endif
+
+.if !empty(PKG_OPTIONS:Mblocklist)
+CONFIGURE_ARGS+=       --with-blocklist=yes
+.else
+CONFIGURE_ARGS+=       --with-blocklist=no
+.endif
+
+.if !empty(PKG_OPTIONS:Mgeoip)
+CONFIGURE_ARGS+=       --with-geoip=${PREFIX}
+LDFLAGS+=              -lGeoIP
+.include "../../net/GeoIP/buildlink3.mk"
+.endif
+
+.if !empty(PKG_OPTIONS:Mtuning)
+CONFIGURE_ARGS+=       --with-tuning=large
+.endif
+
+.if !empty(PKG_OPTIONS:Mdnstap)
+CONFIGURE_ARGS+=       --enable-dnstap
+PLIST.dnstap=          yes
+.include "../../net/fstrm/buildlink3.mk"
+.include "../../devel/protobuf/buildlink3.mk"
+.include "../../devel/protobuf-c/buildlink3.mk"
+.endif
+
+###
+### The statistics server in bind99 and later needs libxml2
+###
+.if !empty(PKG_OPTIONS:Mbind-xml-statistics-server)
+.include "../../textproc/libxml2/buildlink3.mk"
+CONFIGURE_ARGS+=       --with-libxml2
+LDFLAGS+=              -lxml2
+.else
+CONFIGURE_ARGS+=       --without-libxml2
+.endif
+
+###
+### The statistics server in bind911 and later supports json
+###
+.if !empty(PKG_OPTIONS:Mbind-json-statistics-server)
+.include "../../textproc/json-c/buildlink3.mk"
+CONFIGURE_ARGS+=       --with-json-c=yes
+.else
+CONFIGURE_ARGS+=       --with-json-c=no
+.endif
+
+###
+### pthreads support (also see magic above)
+###
+.if !empty(PKG_OPTIONS:Mthreads)
+PTHREAD_AUTO_VARS=     yes
+.endif
+
+###
+### readline support in dig(1) and nsupdate(1).
+###
+.if !empty(PKG_OPTIONS:Mreadline)
+.include "../../devel/readline/buildlink3.mk"
+CONFIGURE_ARGS+=       --with-readline
+.else
+CONFIGURE_ARGS+=       --without-readline
+.endif
+
+###
+### dig(1) option +sigchase for DNSSEC signature chasing
+###
+.if !empty(PKG_OPTIONS:Mbind-dig-sigchase)
+# If anything else needs to add entries to STD_CDEFINES, this will need
+# to be changed so that the two can cooperate.
+CONFIGURE_ENV+=                STD_CDEFINES=-DDIG_SIGCHASE=1
+.endif

Index: pkgsrc/net/bind918/patches/patch-bin_named_main.c
diff -u /dev/null pkgsrc/net/bind918/patches/patch-bin_named_main.c:1.1
--- /dev/null   Sun Dec 11 01:57:55 2022
+++ pkgsrc/net/bind918/patches/patch-bin_named_main.c   Sun Dec 11 01:57:55 2022
@@ -0,0 +1,28 @@
+$NetBSD: patch-bin_named_main.c,v 1.1 2022/12/11 01:57:55 sekiya Exp $
+
+* Based on NetBSD, add support for blocklist(blacklist).
+
+--- bin/named/main.c.orig      2022-11-08 07:17:42.008258118 +0900
++++ bin/named/main.c   2022-12-10 10:08:58.013997862 +0900
+@@ -98,6 +98,10 @@
+ #ifdef HAVE_LIBNGHTTP2
+ #include <nghttp2/nghttp2.h>
+ #endif
++#if defined(HAVE_BLACKLIST_H) || defined(HAVE_BLOCKLIST_H)
++#include <ns/pfilter.h>
++#endif
++
+ /*
+  * Include header files for database drivers here.
+  */
+@@ -1530,6 +1534,10 @@
+ 
+       parse_command_line(argc, argv);
+ 
++#if defined(HAVE_BLACKLIST_H) || defined(HAVE_BLOCKLIST_H)
++      pfilter_enable();
++#endif
++
+ #ifdef ENABLE_AFL
+       if (named_g_fuzz_type != isc_fuzz_none) {
+               named_fuzz_setup();
Index: pkgsrc/net/bind918/patches/patch-bin_named_os.c
diff -u /dev/null pkgsrc/net/bind918/patches/patch-bin_named_os.c:1.1
--- /dev/null   Sun Dec 11 01:57:55 2022
+++ pkgsrc/net/bind918/patches/patch-bin_named_os.c     Sun Dec 11 01:57:55 2022
@@ -0,0 +1,20 @@
+$NetBSD: patch-bin_named_os.c,v 1.1 2022/12/11 01:57:55 sekiya Exp $
+
+* Take from NetBSD base.
+
+--- bin/named/os.c.orig        2021-09-07 09:37:05.000000000 +0000
++++ bin/named/os.c
+@@ -125,11 +125,10 @@ linux_setcaps(cap_t caps) {
+               }                                                             \
+       } while (0)
+ #define FREE_CAP                   \
+-      {                          \
++      do {                       \
+               cap_free(caps);    \
+               cap_free(curcaps); \
+-      }                          \
+-      while (0)
++      } while (0)
+ 
+ static void
+ linux_initialprivs(void) {
Index: pkgsrc/net/bind918/patches/patch-bin_named_server.c
diff -u /dev/null pkgsrc/net/bind918/patches/patch-bin_named_server.c:1.1
--- /dev/null   Sun Dec 11 01:57:55 2022
+++ pkgsrc/net/bind918/patches/patch-bin_named_server.c Sun Dec 11 01:57:55 2022
@@ -0,0 +1,39 @@
+$NetBSD: patch-bin_named_server.c,v 1.1 2022/12/11 01:57:55 sekiya Exp $
+
+* Take from NetBSD base, especially disable checking working directory
+  is writable as BIND_USER in NetBSD base system.
+
+--- bin/named/server.c.orig    2020-05-06 09:59:35.000000000 +0000
++++ bin/named/server.c
+@@ -6667,12 +6667,14 @@ directory_callback(const char *clausenam
+                           directory);
+       }
+ 
++#if 0
+       if (!isc_file_isdirwritable(directory)) {
+               isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
+                             NAMED_LOGMODULE_SERVER, ISC_LOG_ERROR,
+                             "directory '%s' is not writable", directory);
+               return (ISC_R_NOPERM);
+       }
++#endif
+ 
+       result = isc_dir_chdir(directory);
+       if (result != ISC_R_SUCCESS) {
+@@ -9110,6 +9112,7 @@ load_configuration(const char *filename,
+               named_os_changeuser();
+       }
+ 
++#if 0
+       /*
+        * Check that the working directory is writable.
+        */
+@@ -9120,7 +9123,7 @@ load_configuration(const char *filename,
+               result = ISC_R_NOPERM;
+               goto cleanup;
+       }
+-
++#endif
+ #ifdef HAVE_LMDB
+       /*
+        * Reopen NZD databases.
Index: pkgsrc/net/bind918/patches/patch-config.h.in
diff -u /dev/null pkgsrc/net/bind918/patches/patch-config.h.in:1.1
--- /dev/null   Sun Dec 11 01:57:55 2022
+++ pkgsrc/net/bind918/patches/patch-config.h.in        Sun Dec 11 01:57:55 2022
@@ -0,0 +1,19 @@
+$NetBSD: patch-config.h.in,v 1.1 2022/12/11 01:57:55 sekiya Exp $
+
+* Based on NetBSD, add support for blocklist(blacklist).
+
+--- config.h.in.orig   2022-03-07 08:48:03.000000000 +0000
++++ config.h.in
+@@ -54,6 +54,12 @@
+ /* Define to 1 if you have the `BN_GENCB_new' function. */
+ #undef HAVE_BN_GENCB_NEW
+ 
++/* Define to 1 if blacklist is supported. */
++#undef HAVE_BLACKLIST_H
++
++/* Define to 1 if blocklist is supported. */
++#undef HAVE_BLOCKLIST_H
++
+ /* Define to 1 if the compiler supports __builtin_clz. */
+ #undef HAVE_BUILTIN_CLZ
+ 
Index: pkgsrc/net/bind918/patches/patch-configure.ac
diff -u /dev/null pkgsrc/net/bind918/patches/patch-configure.ac:1.1
--- /dev/null   Sun Dec 11 01:57:55 2022
+++ pkgsrc/net/bind918/patches/patch-configure.ac       Sun Dec 11 01:57:55 2022
@@ -0,0 +1,42 @@
+$NetBSD: patch-configure.ac,v 1.1 2022/12/11 01:57:55 sekiya Exp $
+
+Add support for blocklist(blacklist).
+
+--- configure.ac.orig  2022-11-08 07:17:42.020258069 +0900
++++ configure.ac       2022-12-10 11:45:02.065611825 +0900
+@@ -540,6 +540,16 @@
+ AC_CHECK_FUNCS([pthread_setname_np pthread_set_name_np])
+ AC_CHECK_HEADERS([pthread_np.h], [], [], [#include <pthread.h>])
+ 
++# libblocklist(libblacklist)
++AC_MSG_CHECKING(for libblocklist)
++AC_CHECK_HEADER([blocklist.h],
++  [AC_DEFINE([HAVE_BLOCKLIST_H], [1], [blocklist support])
++   AC_CHECK_LIB(blocklist, blocklist)],
++  [AC_MSG_CHECKING(for libblacklist)
++   AC_CHECK_HEADER([blacklist.h],
++   [AC_DEFINE([HAVE_BLACKLIST_H], [1], [blacklist support])
++    AC_CHECK_LIB(blacklist, blacklist)])])
++
+ # libuv
+ AC_MSG_CHECKING([for libuv])
+ PKG_CHECK_MODULES([LIBUV], [libuv >= 1.0.0], [],
+@@ -1212,6 +1222,18 @@
+       [AC_DEFINE([DNS_RDATASET_FIXED], [1],
+                [Define to enable "rrset-order fixed" syntax.])])
+ 
++# blocklist
++AC_ARG_WITH([blocklist],
++          [AS_HELP_STRING([--with-blocklist],
++              [enable blocklist support [yes|no|detect] (default is detect)])],
++              [], [with_blocklist="$with_blocklist"])
++
++# blacklist
++AC_ARG_WITH([blacklist],
++          [AS_HELP_STRING([--with-blacklist],
++              [enable blacklist support [yes|no|detect] (default is detect)])],
++              [], [with_blacklist="$with_blacklist"])
++
+ #
+ # Activate dnstap?
+ #
Index: pkgsrc/net/bind918/patches/patch-lib_dns_byaddr.c
diff -u /dev/null pkgsrc/net/bind918/patches/patch-lib_dns_byaddr.c:1.1
--- /dev/null   Sun Dec 11 01:57:55 2022
+++ pkgsrc/net/bind918/patches/patch-lib_dns_byaddr.c   Sun Dec 11 01:57:55 2022
@@ -0,0 +1,15 @@
+$NetBSD: patch-lib_dns_byaddr.c,v 1.1 2022/12/11 01:57:55 sekiya Exp $
+
+* C syntax.
+
+--- lib/dns/byaddr.c.orig      2020-05-06 09:59:35.000000000 +0000
++++ lib/dns/byaddr.c
+@@ -160,7 +160,7 @@ lookup_done(isc_task_t *task, isc_event_
+               byaddr->event->result = levent->result;
+       }
+       isc_event_free(&event);
+-      isc_task_sendanddetach(&byaddr->task, (isc_event_t **)&byaddr->event);
++      isc_task_sendanddetach(&byaddr->task, (isc_event_t **)(void *)&byaddr->event);
+ }
+ 
+ static void
Index: pkgsrc/net/bind918/patches/patch-lib_dns_gssapi__link.c
diff -u /dev/null pkgsrc/net/bind918/patches/patch-lib_dns_gssapi__link.c:1.1
--- /dev/null   Sun Dec 11 01:57:55 2022
+++ pkgsrc/net/bind918/patches/patch-lib_dns_gssapi__link.c     Sun Dec 11 01:57:55 2022
@@ -0,0 +1,16 @@
+$NetBSD: patch-lib_dns_gssapi__link.c,v 1.1 2022/12/11 01:57:55 sekiya Exp $
+
+* Take from NetBSD base.
+
+--- lib/dns/gssapi_link.c.orig 2022-04-11 15:28:12.000000000 +0000
++++ lib/dns/gssapi_link.c
+@@ -128,6 +128,9 @@ gssapi_sign(dst_context_t *dctx, isc_buf
+       gss_ctx_id_t gssctx = dctx->key->keydata.gssctx;
+       char buf[1024];
+ 
++      if (sizeof(buf) < sig->length)
++              abort();
++
+       /*
+        * Convert the data we wish to sign into a structure gssapi can
+        * understand.
Index: pkgsrc/net/bind918/patches/patch-lib_dns_include_dns_zone.h
diff -u /dev/null pkgsrc/net/bind918/patches/patch-lib_dns_include_dns_zone.h:1.1
--- /dev/null   Sun Dec 11 01:57:55 2022
+++ pkgsrc/net/bind918/patches/patch-lib_dns_include_dns_zone.h Sun Dec 11 01:57:55 2022
@@ -0,0 +1,26 @@
+$NetBSD: patch-lib_dns_include_dns_zone.h,v 1.1 2022/12/11 01:57:55 sekiya Exp $
+
+No need to use atomic 64-bit integers for flags fit within 32-bit width.
+
+--- lib/dns/include/dns/zone.h.orig    2021-09-07 09:37:05.000000000 +0000
++++ lib/dns/include/dns/zone.h
+@@ -96,7 +96,9 @@ typedef enum {
+       DNS_ZONEOPT_CHECKSPF = 1 << 27,         /*%< check SPF records */
+       DNS_ZONEOPT_CHECKTTL = 1 << 28,         /*%< check max-zone-ttl */
+       DNS_ZONEOPT_AUTOEMPTY = 1 << 29,        /*%< automatic empty zone */
++#if 0
+       DNS_ZONEOPT___MAX = UINT64_MAX, /* trick to make the ENUM 64-bit wide */
++#endif
+ } dns_zoneopt_t;
+ 
+ /*
+@@ -108,7 +110,9 @@ typedef enum {
+       DNS_ZONEKEY_CREATE = 0x00000004U,   /*%< make keys when needed */
+       DNS_ZONEKEY_FULLSIGN = 0x00000008U, /*%< roll to new keys immediately */
+       DNS_ZONEKEY_NORESIGN = 0x00000010U, /*%< no automatic resigning */
++#if 0
+       DNS_ZONEKEY___MAX = UINT64_MAX, /* trick to make the ENUM 64-bit wide */
++#endif
+ } dns_zonekey_t;
+ 
+ #ifndef DNS_ZONE_MINREFRESH
Index: pkgsrc/net/bind918/patches/patch-lib_dns_lookup.c
diff -u /dev/null pkgsrc/net/bind918/patches/patch-lib_dns_lookup.c:1.1
--- /dev/null   Sun Dec 11 01:57:55 2022
+++ pkgsrc/net/bind918/patches/patch-lib_dns_lookup.c   Sun Dec 11 01:57:55 2022
@@ -0,0 +1,15 @@
+$NetBSD: patch-lib_dns_lookup.c,v 1.1 2022/12/11 01:57:55 sekiya Exp $
+
+* Take from NetBSD base.
+
+--- lib/dns/lookup.c.orig      2019-04-06 20:09:59.000000000 +0000
++++ lib/dns/lookup.c
+@@ -339,7 +339,7 @@ lookup_find(dns_lookup_t *lookup, dns_fe
+               lookup->event->result = result;
+               lookup->event->ev_sender = lookup;
+               isc_task_sendanddetach(&lookup->task,
+-                                     (isc_event_t **)&lookup->event);
++                                     (isc_event_t **)(void *)&lookup->event);
+               dns_view_detach(&lookup->view);
+       }
+ 
Index: pkgsrc/net/bind918/patches/patch-lib_dns_rbtdb.c
diff -u /dev/null pkgsrc/net/bind918/patches/patch-lib_dns_rbtdb.c:1.1
--- /dev/null   Sun Dec 11 01:57:55 2022
+++ pkgsrc/net/bind918/patches/patch-lib_dns_rbtdb.c    Sun Dec 11 01:57:55 2022
@@ -0,0 +1,15 @@
+$NetBSD: patch-lib_dns_rbtdb.c,v 1.1 2022/12/11 01:57:55 sekiya Exp $
+
+* Take from NetBSD base.
+
+--- lib/dns/rbtdb.c.orig       2022-04-11 15:28:12.000000000 +0000
++++ lib/dns/rbtdb.c
+@@ -2277,7 +2277,7 @@ prune_tree(isc_task_t *task, isc_event_t
+       NODE_UNLOCK(&rbtdb->node_locks[locknum].lock, isc_rwlocktype_write);
+       RWUNLOCK(&rbtdb->tree_lock, isc_rwlocktype_write);
+ 
+-      detach((dns_db_t **)&rbtdb);
++      detach((dns_db_t **)(void *)&rbtdb);
+ }
+ 
+ static void
Index: pkgsrc/net/bind918/patches/patch-lib_dns_request.c
diff -u /dev/null pkgsrc/net/bind918/patches/patch-lib_dns_request.c:1.1
--- /dev/null   Sun Dec 11 01:57:55 2022
+++ pkgsrc/net/bind918/patches/patch-lib_dns_request.c  Sun Dec 11 01:57:55 2022
@@ -0,0 +1,24 @@
+$NetBSD: patch-lib_dns_request.c,v 1.1 2022/12/11 01:57:55 sekiya Exp $
+
+* Take from NetBSD base.
+
+--- lib/dns/request.c.orig     2022-11-08 07:17:42.040257986 +0900
++++ lib/dns/request.c  2022-12-10 10:41:02.459958123 +0900
+@@ -1136,7 +1136,7 @@
+       request->event->ev_sender = request;
+       request->event->result = result;
+ 
+-      isc_task_sendanddetach(&task, (isc_event_t **)&request->event);
++      isc_task_sendanddetach(&task, (isc_event_t **)(void *)&request->event);
+ }
+ 
+ static void
+@@ -1193,7 +1193,7 @@
+               isc_buffer_free(&request->answer);
+       }
+       if (request->event != NULL) {
+-              isc_event_free((isc_event_t **)&request->event);
++              isc_event_free((isc_event_t **)(void *)&request->event);
+       }
+       if (request->dispentry != NULL) {
+               dns_dispatch_done(&request->dispentry);
Index: pkgsrc/net/bind918/patches/patch-lib_dns_sdb.c
diff -u /dev/null pkgsrc/net/bind918/patches/patch-lib_dns_sdb.c:1.1
--- /dev/null   Sun Dec 11 01:57:55 2022
+++ pkgsrc/net/bind918/patches/patch-lib_dns_sdb.c      Sun Dec 11 01:57:55 2022
@@ -0,0 +1,15 @@
+$NetBSD: patch-lib_dns_sdb.c,v 1.1 2022/12/11 01:57:55 sekiya Exp $
+
+* Take from NetBSD base.
+
+--- lib/dns/sdb.c.orig 2020-05-06 09:59:35.000000000 +0000
++++ lib/dns/sdb.c
+@@ -621,7 +621,7 @@ createnode(dns_sdb_t *sdb, dns_sdbnode_t
+       node = isc_mem_get(sdb->common.mctx, sizeof(dns_sdbnode_t));
+ 
+       node->sdb = NULL;
+-      attach((dns_db_t *)sdb, (dns_db_t **)&node->sdb);
++      attach((dns_db_t *)sdb, (dns_db_t **)(void *)&node->sdb);
+       ISC_LIST_INIT(node->lists);
+       ISC_LIST_INIT(node->buffers);
+       ISC_LINK_INIT(node, link);
Index: pkgsrc/net/bind918/patches/patch-lib_dns_sdlz.c
diff -u /dev/null pkgsrc/net/bind918/patches/patch-lib_dns_sdlz.c:1.1
--- /dev/null   Sun Dec 11 01:57:55 2022
+++ pkgsrc/net/bind918/patches/patch-lib_dns_sdlz.c     Sun Dec 11 01:57:55 2022
@@ -0,0 +1,22 @@
+$NetBSD: patch-lib_dns_sdlz.c,v 1.1 2022/12/11 01:57:55 sekiya Exp $
+
+* Take from NetBSD base.
+
+--- lib/dns/sdlz.c.orig        2020-05-06 09:59:35.000000000 +0000
++++ lib/dns/sdlz.c
+@@ -451,11 +451,14 @@ closeversion(dns_db_t *db, dns_dbversion
+ static isc_result_t
+ createnode(dns_sdlz_db_t *sdlz, dns_sdlznode_t **nodep) {
+       dns_sdlznode_t *node;
++      void *sdlzv, *tdlzv;
+ 
+       node = isc_mem_get(sdlz->common.mctx, sizeof(dns_sdlznode_t));
+ 
+       node->sdlz = NULL;
+-      attach((dns_db_t *)sdlz, (dns_db_t **)&node->sdlz);
++      sdlzv = sdlz;
++      tdlzv = &node->sdlz;
++      attach(sdlzv, tdlzv);
+       ISC_LIST_INIT(node->lists);
+       ISC_LIST_INIT(node->buffers);
+       ISC_LINK_INIT(node, link);
Index: pkgsrc/net/bind918/patches/patch-lib_dns_validator.c
diff -u /dev/null pkgsrc/net/bind918/patches/patch-lib_dns_validator.c:1.1
--- /dev/null   Sun Dec 11 01:57:55 2022
+++ pkgsrc/net/bind918/patches/patch-lib_dns_validator.c        Sun Dec 11 01:57:55 2022
@@ -0,0 +1,15 @@
+$NetBSD: patch-lib_dns_validator.c,v 1.1 2022/12/11 01:57:55 sekiya Exp $
+
+* Take from NetBSD base.
+
+--- lib/dns/validator.c.orig   2020-05-06 09:59:35.000000000 +0000
++++ lib/dns/validator.c
+@@ -221,7 +221,7 @@ validator_done(dns_validator_t *val, isc
+       val->event->ev_type = DNS_EVENT_VALIDATORDONE;
+       val->event->ev_action = val->action;
+       val->event->ev_arg = val->arg;
+-      isc_task_sendanddetach(&task, (isc_event_t **)&val->event);
++      isc_task_sendanddetach(&task, (isc_event_t **)(void *)&val->event);
+ }
+ 
+ /*
Index: pkgsrc/net/bind918/patches/patch-lib_dns_view.c
diff -u /dev/null pkgsrc/net/bind918/patches/patch-lib_dns_view.c:1.1
--- /dev/null   Sun Dec 11 01:57:55 2022
+++ pkgsrc/net/bind918/patches/patch-lib_dns_view.c     Sun Dec 11 01:57:55 2022
@@ -0,0 +1,15 @@
+$NetBSD: patch-lib_dns_view.c,v 1.1 2022/12/11 01:57:55 sekiya Exp $
+
+* Use nta sub-directory as NetBSD base system.
+
+--- lib/dns/view.c.orig        2020-05-06 09:59:35.000000000 +0000
++++ lib/dns/view.c
+@@ -105,7 +105,7 @@ dns_view_create(isc_mem_t *mctx, dns_rda
+       isc_mem_attach(mctx, &view->mctx);
+       view->name = isc_mem_strdup(mctx, name);
+ 
+-      result = isc_file_sanitize(NULL, view->name, "nta", buffer,
++      result = isc_file_sanitize("nta", view->name, "nta", buffer,
+                                  sizeof(buffer));
+       if (result != ISC_R_SUCCESS) {
+               goto cleanup_name;
Index: pkgsrc/net/bind918/patches/patch-lib_dns_zone.c
diff -u /dev/null pkgsrc/net/bind918/patches/patch-lib_dns_zone.c:1.1
--- /dev/null   Sun Dec 11 01:57:55 2022
+++ pkgsrc/net/bind918/patches/patch-lib_dns_zone.c     Sun Dec 11 01:57:55 2022
@@ -0,0 +1,47 @@
+$NetBSD: patch-lib_dns_zone.c,v 1.1 2022/12/11 01:57:55 sekiya Exp $
+
+No need to use atomic 64-bit integers for flags fit within 32-bit width.
+
+--- lib/dns/zone.c.orig        2021-09-07 09:37:05.000000000 +0000
++++ lib/dns/zone.c
+@@ -246,8 +246,13 @@ struct dns_zone {
+       int32_t journalsize;
+       dns_rdataclass_t rdclass;
+       dns_zonetype_t type;
++#if 1
++      atomic_uint_fast32_t flags;
++      atomic_uint_fast32_t options;
++#else
+       atomic_uint_fast64_t flags;
+       atomic_uint_fast64_t options;
++#endif
+       unsigned int db_argc;
+       char **db_argv;
+       isc_time_t expiretime;
+@@ -405,7 +410,11 @@ struct dns_zone {
+       /*%
+        * Autosigning/key-maintenance options
+        */
++#if 1
++      atomic_uint_fast32_t keyopts;
++#else
+       atomic_uint_fast64_t keyopts;
++#endif
+ 
+       /*%
+        * True if added by "rndc addzone"
+@@ -537,12 +546,14 @@ typedef enum {
+                                                     * notify due to the zone
+                                                     * just being loaded for
+                                                     * the first time. */
++#if 0
+       /*
+        * DO NOT add any new zone flags here until all platforms
+        * support 64-bit enum values. Currently they fail on
+        * Windows.
+        */
+       DNS_ZONEFLG___MAX = UINT64_MAX, /* trick to make the ENUM 64-bit wide */
++#endif
+ } dns_zoneflg_t;
+ 
+ #define DNS_ZONE_OPTION(z, o)  ((atomic_load_relaxed(&(z)->options) & (o)) != 0)
Index: pkgsrc/net/bind918/patches/patch-lib_isc_app.c
diff -u /dev/null pkgsrc/net/bind918/patches/patch-lib_isc_app.c:1.1
--- /dev/null   Sun Dec 11 01:57:55 2022
+++ pkgsrc/net/bind918/patches/patch-lib_isc_app.c      Sun Dec 11 01:57:55 2022
@@ -0,0 +1,24 @@
+$NetBSD: patch-lib_isc_app.c,v 1.1 2022/12/11 01:57:55 sekiya Exp $
+
+* Take from NetBSD base.
+
+--- lib/isc/app.c.orig 2022-11-08 07:17:42.048257952 +0900
++++ lib/isc/app.c      2022-12-10 10:44:08.372064499 +0900
+@@ -120,6 +120,8 @@
+        * blocked by default, ensuring that only the thread that calls
+        * sigwait() for them will get those signals.
+        */
++      if (isc_bind9) {
++
+       if (sigemptyset(&sset) != 0 || sigaddset(&sset, SIGHUP) != 0 ||
+           sigaddset(&sset, SIGINT) != 0 || sigaddset(&sset, SIGTERM) != 0)
+       {
+@@ -130,6 +132,8 @@
+               FATAL_SYSERROR(presult, "pthread_sigmask()");
+       }
+ 
++      }
++
+       return (ISC_R_SUCCESS);
+ }
+ 
Index: pkgsrc/net/bind918/patches/patch-lib_isc_include_isc_netmgr.h
diff -u /dev/null pkgsrc/net/bind918/patches/patch-lib_isc_include_isc_netmgr.h:1.1
--- /dev/null   Sun Dec 11 01:57:55 2022
+++ pkgsrc/net/bind918/patches/patch-lib_isc_include_isc_netmgr.h       Sun Dec 11 01:57:55 2022
@@ -0,0 +1,16 @@
+$NetBSD: patch-lib_isc_include_isc_netmgr.h,v 1.1 2022/12/11 01:57:55 sekiya Exp $
+
+Declare missing prototype.
+
+--- lib/isc/include/isc/netmgr.h.orig  2021-03-11 13:20:59.000000000 +0000
++++ lib/isc/include/isc/netmgr.h
+@@ -146,6 +146,9 @@ isc_nmhandle_getdata(isc_nmhandle_t *han
+ void *
+ isc_nmhandle_getextra(isc_nmhandle_t *handle);
+ 
++int
++isc_nmhandle_getfd(isc_nmhandle_t *handle);
++
+ bool
+ isc_nmhandle_is_stream(isc_nmhandle_t *handle);
+ 
Index: pkgsrc/net/bind918/patches/patch-lib_isc_net.c
diff -u /dev/null pkgsrc/net/bind918/patches/patch-lib_isc_net.c:1.1
--- /dev/null   Sun Dec 11 01:57:55 2022
+++ pkgsrc/net/bind918/patches/patch-lib_isc_net.c      Sun Dec 11 01:57:55 2022
@@ -0,0 +1,23 @@
+$NetBSD: patch-lib_isc_net.c,v 1.1 2022/12/11 01:57:55 sekiya Exp $
+
+* Fix build on SmartOS. In this special case, _XOPEN_SOURCE has to be only
+  defined on SmartOS.
+
+--- lib/isc/net.c.orig 2020-05-06 09:59:35.000000000 +0000
++++ lib/isc/net.c
+@@ -9,6 +9,15 @@
+  * information regarding copyright ownership.
+  */
+ 
++/* needed for CMSG_DATA */
++#if defined(__sun)
++#if (__STDC_VERSION__ - 0 < 199901L)
++#define _XOPEN_SOURCE 500
++#else
++#define _XOPEN_SOURCE 600
++#endif
++#endif
++
+ #include <stdbool.h>
+ #include <sys/types.h>
+ 
Index: pkgsrc/net/bind918/patches/patch-lib_isc_netmgr_netmgr-int.h
diff -u /dev/null pkgsrc/net/bind918/patches/patch-lib_isc_netmgr_netmgr-int.h:1.1
--- /dev/null   Sun Dec 11 01:57:55 2022
+++ pkgsrc/net/bind918/patches/patch-lib_isc_netmgr_netmgr-int.h        Sun Dec 11 01:57:55 2022
@@ -0,0 +1,102 @@
+$NetBSD: patch-lib_isc_netmgr_netmgr-int.h,v 1.1 2022/12/11 01:57:55 sekiya Exp $
+
+* Take from NetBSD base.
+
+--- lib/isc/netmgr/netmgr-int.h.orig   2022-06-02 19:34:02.000000000 +0000
++++ lib/isc/netmgr/netmgr-int.h
+@@ -408,13 +408,13 @@ typedef struct isc__netievent__socket {
+ } isc__netievent__socket_t;
+ 
+ #define NETIEVENT_SOCKET_TYPE(type) \
+-      typedef isc__netievent__socket_t isc__netievent_##type##_t;
++      typedef isc__netievent__socket_t isc__netievent_##type##_t
+ 
+ #define NETIEVENT_SOCKET_DECL(type)                              \
+       isc__netievent_##type##_t *isc__nm_get_netievent_##type( \
+               isc_nm_t *nm, isc_nmsocket_t *sock);             \
+       void isc__nm_put_netievent_##type(isc_nm_t *nm,          \
+-                                        isc__netievent_##type##_t *ievent);
++                                        isc__netievent_##type##_t *ievent)
+ 
+ #define NETIEVENT_SOCKET_DEF(type)                                             \
+       isc__netievent_##type##_t *isc__nm_get_netievent_##type(               \
+@@ -438,13 +438,13 @@ typedef struct isc__netievent__socket_re
+ } isc__netievent__socket_req_t;
+ 
+ #define NETIEVENT_SOCKET_REQ_TYPE(type) \
+-      typedef isc__netievent__socket_req_t isc__netievent_##type##_t;
++      typedef isc__netievent__socket_req_t isc__netievent_##type##_t
+ 
+ #define NETIEVENT_SOCKET_REQ_DECL(type)                                    \
+       isc__netievent_##type##_t *isc__nm_get_netievent_##type(           \
+               isc_nm_t *nm, isc_nmsocket_t *sock, isc__nm_uvreq_t *req); \
+       void isc__nm_put_netievent_##type(isc_nm_t *nm,                    \
+-                                        isc__netievent_##type##_t *ievent);
++                                        isc__netievent_##type##_t *ievent)
+ 
+ #define NETIEVENT_SOCKET_REQ_DEF(type)                                         \
+       isc__netievent_##type##_t *isc__nm_get_netievent_##type(               \
+@@ -470,14 +470,14 @@ typedef struct isc__netievent__socket_re
+ } isc__netievent__socket_req_result_t;
+ 
+ #define NETIEVENT_SOCKET_REQ_RESULT_TYPE(type) \
+-      typedef isc__netievent__socket_req_result_t isc__netievent_##type##_t;
++      typedef isc__netievent__socket_req_result_t isc__netievent_##type##_t
+ 
+ #define NETIEVENT_SOCKET_REQ_RESULT_DECL(type)                            \
+       isc__netievent_##type##_t *isc__nm_get_netievent_##type(          \
+               isc_nm_t *nm, isc_nmsocket_t *sock, isc__nm_uvreq_t *req, \
+               isc_result_t result);                                     \
+       void isc__nm_put_netievent_##type(isc_nm_t *nm,                   \
+-                                        isc__netievent_##type##_t *ievent);
++                                        isc__netievent_##type##_t *ievent)
+ 
+ #define NETIEVENT_SOCKET_REQ_RESULT_DEF(type)                                  \
+       isc__netievent_##type##_t *isc__nm_get_netievent_##type(               \
+@@ -504,13 +504,13 @@ typedef struct isc__netievent__socket_ha
+ } isc__netievent__socket_handle_t;
+ 
+ #define NETIEVENT_SOCKET_HANDLE_TYPE(type) \
+-      typedef isc__netievent__socket_handle_t isc__netievent_##type##_t;
++      typedef isc__netievent__socket_handle_t isc__netievent_##type##_t
+ 
+ #define NETIEVENT_SOCKET_HANDLE_DECL(type)                                   \
+       isc__netievent_##type##_t *isc__nm_get_netievent_##type(             \
+               isc_nm_t *nm, isc_nmsocket_t *sock, isc_nmhandle_t *handle); \
+       void isc__nm_put_netievent_##type(isc_nm_t *nm,                      \
+-                                        isc__netievent_##type##_t *ievent);
++                                        isc__netievent_##type##_t *ievent)
+ 
+ #define NETIEVENT_SOCKET_HANDLE_DEF(type)                                      \
+       isc__netievent_##type##_t *isc__nm_get_netievent_##type(               \
+@@ -536,13 +536,13 @@ typedef struct isc__netievent__socket_qu
+ } isc__netievent__socket_quota_t;
+ 
+ #define NETIEVENT_SOCKET_QUOTA_TYPE(type) \
+-      typedef isc__netievent__socket_quota_t isc__netievent_##type##_t;
++      typedef isc__netievent__socket_quota_t isc__netievent_##type##_t
+ 
+ #define NETIEVENT_SOCKET_QUOTA_DECL(type)                                \
+       isc__netievent_##type##_t *isc__nm_get_netievent_##type(         \
+               isc_nm_t *nm, isc_nmsocket_t *sock, isc_quota_t *quota); \
+       void isc__nm_put_netievent_##type(isc_nm_t *nm,                  \
+-                                        isc__netievent_##type##_t *ievent);
++                                        isc__netievent_##type##_t *ievent)
+ 
+ #define NETIEVENT_SOCKET_QUOTA_DEF(type)                                       \
+       isc__netievent_##type##_t *isc__nm_get_netievent_##type(               \
+@@ -603,12 +603,12 @@ typedef struct isc__netievent {
+       ISC_LINK(isc__netievent_t) link;
+ } isc__netievent_t;
+ 
+-#define NETIEVENT_TYPE(type) typedef isc__netievent_t isc__netievent_##type##_t;
++#define NETIEVENT_TYPE(type) typedef isc__netievent_t isc__netievent_##type##_t
+ 
+ #define NETIEVENT_DECL(type)                                                   \
+       isc__netievent_##type##_t *isc__nm_get_netievent_##type(isc_nm_t *nm); \
+       void isc__nm_put_netievent_##type(isc_nm_t *nm,                        \
+-                                        isc__netievent_##type##_t *ievent);
++                                        isc__netievent_##type##_t *ievent)
+ 
+ #define NETIEVENT_DEF(type)                                                    \
+       isc__netievent_##type##_t *isc__nm_get_netievent_##type(               \
Index: pkgsrc/net/bind918/patches/patch-lib_isc_netmgr_netmgr.c
diff -u /dev/null pkgsrc/net/bind918/patches/patch-lib_isc_netmgr_netmgr.c:1.1
--- /dev/null   Sun Dec 11 01:57:55 2022
+++ pkgsrc/net/bind918/patches/patch-lib_isc_netmgr_netmgr.c    Sun Dec 11 01:57:55 2022
@@ -0,0 +1,29 @@
+$NetBSD: patch-lib_isc_netmgr_netmgr.c,v 1.1 2022/12/11 01:57:55 sekiya Exp $
+
+* Take from NetBSD base.
+
+--- lib/isc/netmgr/netmgr.c.orig       2021-09-07 09:37:05.000000000 +0000
++++ lib/isc/netmgr/netmgr.c
+@@ -373,7 +373,7 @@ isc__netmgr_create(isc_mem_t *mctx, uint
+               mgr->workers_running++;
+               isc_thread_create(nm_thread, &mgr->workers[i], &worker->thread);
+ 
+-              snprintf(name, sizeof(name), "isc-net-%04zu", i);
++              snprintf(name, sizeof(name), "net-%04zu", i);
+               isc_thread_setname(worker->thread, name);
+       }
+ 
+@@ -1828,6 +1828,13 @@ isc_nmhandle_getdata(isc_nmhandle_t *han
+       return (handle->opaque);
+ }
+ 
++int
++isc_nmhandle_getfd(isc_nmhandle_t *handle) {
++      REQUIRE(VALID_NMHANDLE(handle));
++
++      return (handle->sock->fd);
++}
++
+ void
+ isc_nmhandle_setdata(isc_nmhandle_t *handle, void *arg,
+                    isc_nm_opaquecb_t doreset, isc_nm_opaquecb_t dofree) {
Index: pkgsrc/net/bind918/patches/patch-lib_isc_rwlock.c
diff -u /dev/null pkgsrc/net/bind918/patches/patch-lib_isc_rwlock.c:1.1
--- /dev/null   Sun Dec 11 01:57:55 2022
+++ pkgsrc/net/bind918/patches/patch-lib_isc_rwlock.c   Sun Dec 11 01:57:55 2022
@@ -0,0 +1,33 @@
+$NetBSD: patch-lib_isc_rwlock.c,v 1.1 2022/12/11 01:57:55 sekiya Exp $
+
+* Take from NetBSD base.
+
+--- lib/isc/rwlock.c.orig      2020-05-06 09:59:35.000000000 +0000
++++ lib/isc/rwlock.c
+@@ -142,6 +142,9 @@ isc_rwlock_destroy(isc_rwlock_t *rwl) {
+ #define RWLOCK_MAX_ADAPTIVE_COUNT 100
+ #endif /* ifndef RWLOCK_MAX_ADAPTIVE_COUNT */
+ 
++#ifdef __lint__
++# define isc_rwlock_pause()
++#else
+ #if defined(_MSC_VER)
+ #include <intrin.h>
+ #define isc_rwlock_pause() YieldProcessor()
+@@ -152,7 +155,7 @@ isc_rwlock_destroy(isc_rwlock_t *rwl) {
+ #define isc_rwlock_pause() __asm__ __volatile__("rep; nop")
+ #elif defined(__ia64__)
+ #define isc_rwlock_pause() __asm__ __volatile__("hint @pause")
+-#elif defined(__arm__) && HAVE_ARM_YIELD
++#elif defined(__arm__) && (defined(_ARM_ARCH_6) || HAVE_ARM_YIELD)
+ #define isc_rwlock_pause() __asm__ __volatile__("yield")
+ #elif defined(sun) && (defined(__sparc) || defined(__sparc__))
+ #define isc_rwlock_pause() smt_pause()
+@@ -164,6 +167,7 @@ isc_rwlock_destroy(isc_rwlock_t *rwl) {
+ #else /* if defined(_MSC_VER) */
+ #define isc_rwlock_pause()
+ #endif /* if defined(_MSC_VER) */
++#endif
+ 
+ static isc_result_t
+ isc__rwlock_lock(isc_rwlock_t *rwl, isc_rwlocktype_t type);
Index: pkgsrc/net/bind918/patches/patch-lib_isc_siphash.c
diff -u /dev/null pkgsrc/net/bind918/patches/patch-lib_isc_siphash.c:1.1
--- /dev/null   Sun Dec 11 01:57:55 2022
+++ pkgsrc/net/bind918/patches/patch-lib_isc_siphash.c  Sun Dec 11 01:57:55 2022
@@ -0,0 +1,23 @@
+$NetBSD: patch-lib_isc_siphash.c,v 1.1 2022/12/11 01:57:55 sekiya Exp $
+
+* Take from NetBSD base.
+
+--- lib/isc/siphash.c.orig     2021-09-07 09:37:05.000000000 +0000
++++ lib/isc/siphash.c
+@@ -90,8 +90,14 @@ isc_siphash24(const uint8_t *k, const ui
+       REQUIRE(k != NULL);
+       REQUIRE(out != NULL);
+ 
+-      uint64_t k0 = U8TO64_LE(k);
+-      uint64_t k1 = U8TO64_LE(k + 8);
++      uint64_t k0;
++      uint64_t k1;
++
++      memcpy(&k0, k, sizeof(k0));
++      memcpy(&k1, k + sizeof(k0), sizeof(k1));
++
++      k0 = le64toh(k0);
++      k1 = le64toh(k1);
+ 
+       uint64_t v0 = UINT64_C(0x736f6d6570736575) ^ k0;
+       uint64_t v1 = UINT64_C(0x646f72616e646f6d) ^ k1;
Index: pkgsrc/net/bind918/patches/patch-lib_isc_time.c
diff -u /dev/null pkgsrc/net/bind918/patches/patch-lib_isc_time.c:1.1
--- /dev/null   Sun Dec 11 01:57:55 2022
+++ pkgsrc/net/bind918/patches/patch-lib_isc_time.c     Sun Dec 11 01:57:55 2022
@@ -0,0 +1,35 @@
+$NetBSD: patch-lib_isc_time.c,v 1.1 2022/12/11 01:57:55 sekiya Exp $
+
+* More check time_t range.
+
+--- lib/isc/time.c.orig        2020-05-06 09:59:35.000000000 +0000
++++ lib/isc/time.c
+@@ -285,7 +285,7 @@ isc_time_seconds(const isc_time_t *t) {
+ 
+ isc_result_t
+ isc_time_secondsastimet(const isc_time_t *t, time_t *secondsp) {
+-      time_t seconds;
++      time_t seconds, i;
+ 
+       REQUIRE(t != NULL);
+       INSIST(t->nanoseconds < NS_PER_S);
+@@ -312,7 +312,18 @@ isc_time_secondsastimet(const isc_time_t
+       INSIST(sizeof(unsigned int) == sizeof(uint32_t));
+       INSIST(sizeof(time_t) >= sizeof(uint32_t));
+ 
+-      if (t->seconds > (~0U >> 1) && seconds <= (time_t)(~0U >> 1)) {
++      if (sizeof(time_t) == sizeof(uint32_t) &&              /* Same size. */
++          (time_t)0.5 != 0.5 &&              /* Not a floating point type. */
++          (i = (time_t)-1) != 4294967295u &&                 /* Is signed. */
++          (seconds &
++           (1ULL << (sizeof(time_t) * CHAR_BIT - 1))) != 0ULL) {   /* Negative. */
++              /*
++               * This UNUSED() is here to shut up the IRIX compiler:
++               *      variable "i" was set but never used
++               * when the value of i *was* used in the third test.
++               * (Let's hope the compiler got the actual test right.)
++               */
++              UNUSED(i);
+               return (ISC_R_RANGE);
+       }
+ 
Index: pkgsrc/net/bind918/patches/patch-lib_isc_timer.c
diff -u /dev/null pkgsrc/net/bind918/patches/patch-lib_isc_timer.c:1.1
--- /dev/null   Sun Dec 11 01:57:55 2022
+++ pkgsrc/net/bind918/patches/patch-lib_isc_timer.c    Sun Dec 11 01:57:55 2022
@@ -0,0 +1,15 @@
+$NetBSD: patch-lib_isc_timer.c,v 1.1 2022/12/11 01:57:55 sekiya Exp $
+
+* Take from NetBSD base.
+
+--- lib/isc/timer.c.orig       2021-09-07 09:37:05.000000000 +0000
++++ lib/isc/timer.c
+@@ -696,7 +696,7 @@ isc_timermgr_create(isc_mem_t *mctx, isc
+       isc_mem_attach(mctx, &manager->mctx);
+       isc_condition_init(&manager->wakeup);
+       isc_thread_create(run, manager, &manager->thread);
+-      isc_thread_setname(manager->thread, "isc-timer");
++      isc_thread_setname(manager->thread, "timer");
+ 
+       *managerp = manager;
+ 
Index: pkgsrc/net/bind918/patches/patch-lib_ns_Makefile.am
diff -u /dev/null pkgsrc/net/bind918/patches/patch-lib_ns_Makefile.am:1.1
--- /dev/null   Sun Dec 11 01:57:55 2022
+++ pkgsrc/net/bind918/patches/patch-lib_ns_Makefile.am Sun Dec 11 01:57:55 2022
@@ -0,0 +1,16 @@
+$NetBSD: patch-lib_ns_Makefile.am,v 1.1 2022/12/11 01:57:55 sekiya Exp $
+
+* Based on NetBSD, add support for blocklist(blacklist).
+
+--- lib/ns/Makefile.am.orig    2022-12-10 10:56:03.328767068 +0900
++++ lib/ns/Makefile.am 2022-12-10 10:56:31.205029577 +0900
+@@ -36,7 +36,8 @@
+       sortlist.c              \
+       stats.c                 \
+       update.c                \
+-      xfrout.c
++      xfrout.c                \
++      pfilter.c
+ 
+ libns_la_CPPFLAGS =                           \
+       $(AM_CPPFLAGS)                          \
Index: pkgsrc/net/bind918/patches/patch-lib_ns_client.c
diff -u /dev/null pkgsrc/net/bind918/patches/patch-lib_ns_client.c:1.1
--- /dev/null   Sun Dec 11 01:57:55 2022
+++ pkgsrc/net/bind918/patches/patch-lib_ns_client.c    Sun Dec 11 01:57:55 2022
@@ -0,0 +1,17 @@
+$NetBSD: patch-lib_ns_client.c,v 1.1 2022/12/11 01:57:55 sekiya Exp $
+
+Use 32-bit atomic integers for !_LP64 platforms.
+
+--- lib/ns/client.c.orig       2022-04-11 15:28:12.000000000 +0000
++++ lib/ns/client.c
+@@ -89,8 +89,8 @@
+       isc_log_write(ns_lctx, NS_LOGCATEGORY_CLIENT, NS_LOGMODULE_CLIENT, \
+                     ISC_LOG_DEBUG(3), "clientmgr @%p: %s", manager, (m))
+ #else /* ifdef NS_CLIENT_TRACE */
+-#define CTRACE(m) ((void)(m))
+-#define MTRACE(m) ((void)(m))
++#define CTRACE(m) ((void)/*LINTED*/(m))
++#define MTRACE(m) ((void)/*LINTED*/(m))
+ #endif /* ifdef NS_CLIENT_TRACE */
+ 
+ #define TCP_CLIENT(c) (((c)->attributes & NS_CLIENTATTR_TCP) != 0)
Index: pkgsrc/net/bind918/patches/patch-lib_ns_include_ns_pfilter.h
diff -u /dev/null pkgsrc/net/bind918/patches/patch-lib_ns_include_ns_pfilter.h:1.1
--- /dev/null   Sun Dec 11 01:57:55 2022
+++ pkgsrc/net/bind918/patches/patch-lib_ns_include_ns_pfilter.h        Sun Dec 11 01:57:55 2022
@@ -0,0 +1,9 @@
+$NetBSD: patch-lib_ns_include_ns_pfilter.h,v 1.1 2022/12/11 01:57:55 sekiya Exp $
+
+* Take from NetBSD base.
+
+--- lib/ns/include/ns/pfilter.h.orig   2020-05-27 15:17:34.854399492 +0000
++++ lib/ns/include/ns/pfilter.h
+@@ -0,0 +1,2 @@
++void pfilter_enable(void);
++void pfilter_notify(isc_result_t, ns_client_t *, const char *);
Index: pkgsrc/net/bind918/patches/patch-lib_ns_pfilter.c
diff -u /dev/null pkgsrc/net/bind918/patches/patch-lib_ns_pfilter.c:1.1
--- /dev/null   Sun Dec 11 01:57:55 2022
+++ pkgsrc/net/bind918/patches/patch-lib_ns_pfilter.c   Sun Dec 11 01:57:55 2022
@@ -0,0 +1,65 @@
+$NetBSD: patch-lib_ns_pfilter.c,v 1.1 2022/12/11 01:57:55 sekiya Exp $
+
+* Based on NetBSD, add support for blocklist(blacklist).
+
+--- lib/ns/pfilter.c.orig      2022-12-10 10:59:39.096566039 +0900
++++ lib/ns/pfilter.c   2022-12-10 17:19:23.820075639 +0900
+@@ -0,0 +1,58 @@
++
++#include "config.h"
++
++#include <isc/util.h>
++#include <ns/types.h>
++#include <ns/client.h>
++
++#ifdef HAVE_BLACKLIST_H
++#include <blacklist.h>
++#define blocklist blacklist
++#define blocklist_open blacklist_open
++#define blocklist_sa_r blacklist_sa_r
++#endif
++
++#ifdef HAVE_BLOCKLIST_H
++#include <blocklist.h>
++#endif
++
++#if defined(HAVE_BLACKLIST_H) || defined(HAVE_BLOCKLIST_H)
++
++#include <ns/pfilter.h>
++
++static struct blocklist *blstate;
++static int blenable;
++
++void
++pfilter_enable(void) {
++      blenable = 1;
++}
++
++#define TCP_CLIENT(c)  (((c)->attributes & NS_CLIENTATTR_TCP) != 0)
++
++void
++pfilter_notify(isc_result_t res, ns_client_t *client, const char *msg)
++{
++      int fd;
++
++      if (!blenable)
++              return;
++
++      if (blstate == NULL)
++              blstate = blocklist_open();
++
++      if (blstate == NULL)
++              return;
++
++      if (!TCP_CLIENT(client) && !client->peeraddr_valid)
++              return;
++
++      if ((fd = isc_nmhandle_getfd(client->handle)) == -1)
++              return;
++
++      blocklist_sa_r(blstate, 
++          res != ISC_R_SUCCESS, fd,
++          &client->peeraddr.type.sa, client->peeraddr.length, msg);
++}
++
++#endif
Index: pkgsrc/net/bind918/patches/patch-lib_ns_query.c
diff -u /dev/null pkgsrc/net/bind918/patches/patch-lib_ns_query.c:1.1
--- /dev/null   Sun Dec 11 01:57:55 2022
+++ pkgsrc/net/bind918/patches/patch-lib_ns_query.c     Sun Dec 11 01:57:55 2022
@@ -0,0 +1,37 @@
+$NetBSD: patch-lib_ns_query.c,v 1.1 2022/12/11 01:57:55 sekiya Exp $
+
+* Based on NetBSD, add support for blocklist(blacklist).
+
+--- lib/ns/query.c.orig        2022-11-08 07:17:42.056257919 +0900
++++ lib/ns/query.c     2022-12-10 11:00:47.549957781 +0900
+@@ -74,6 +74,10 @@
+ #include <ns/stats.h>
+ #include <ns/xfrout.h>
+ 
++#if defined(HAVE_BLACKLIST_H) || defined(HAVE_BLOCKLIST_H)
++#include <ns/pfilter.h>
++#endif
++
+ #if 0
+ /*
+  * It has been recommended that DNS64 be changed to return excluded
+@@ -915,6 +919,9 @@
+                                               NULL);
+ 
+                       if (log) {
++#if defined(HAVE_BLACKLIST_H) || defined(HAVE_BLOCKLIST_H)
++                              pfilter_notify(result, client, "checkcacheaccess");
++#endif
+                               ns_client_aclmsg("query (cache)", name, qtype,
+                                                client->view->rdclass, msg,
+                                                sizeof(msg));
+@@ -1043,6 +1050,9 @@
+                                             msg);
+                       }
+               } else {
++#if defined(HAVE_BLACKLIST_H) || defined(HAVE_BLOCKLIST_H)
++                      pfilter_notify(result, client, "validatezonedb");
++#endif
+                       ns_client_aclmsg("query", name, qtype,
+                                        client->view->rdclass, msg,
+                                        sizeof(msg));
Index: pkgsrc/net/bind918/patches/patch-lib_ns_update.c
diff -u /dev/null pkgsrc/net/bind918/patches/patch-lib_ns_update.c:1.1
--- /dev/null   Sun Dec 11 01:57:55 2022
+++ pkgsrc/net/bind918/patches/patch-lib_ns_update.c    Sun Dec 11 01:57:55 2022
@@ -0,0 +1,47 @@
+$NetBSD: patch-lib_ns_update.c,v 1.1 2022/12/11 01:57:55 sekiya Exp $
+
+* Based on NetBSD, add support for blocklist(blacklist).
+
+--- lib/ns/update.c.orig       2020-12-07 08:16:53.000000000 +0000
++++ lib/ns/update.c
+@@ -52,6 +52,10 @@
+ #include <ns/stats.h>
+ #include <ns/update.h>
+ 
++#if defined(HAVE_BLACKLIST_H) || defined(HAVE_BLOCKLIST_H)
++#include <ns/pfilter.h>
++#endif
++
+ /*! \file
+  * \brief
+  * This module implements dynamic update as in RFC2136.
+@@ -340,6 +344,9 @@ checkqueryacl(ns_client_t *client, dns_a
+ 
+       result = ns_client_checkaclsilent(client, NULL, queryacl, true);
+       if (result != ISC_R_SUCCESS) {
++#if defined(HAVE_BLACKLIST_H) || defined(HAVE_BLOCKLIST_H)
++              pfilter_notify(result, client, "queryacl");
++#endif
+               dns_name_format(zonename, namebuf, sizeof(namebuf));
+               dns_rdataclass_format(client->view->rdclass, classbuf,
+                                     sizeof(classbuf));
+@@ -352,6 +359,9 @@ checkqueryacl(ns_client_t *client, dns_a
+                             "update '%s/%s' denied due to allow-query",
+                             namebuf, classbuf);
+       } else if (updateacl == NULL && ssutable == NULL) {
++#if defined(HAVE_BLACKLIST_H) || defined(HAVE_BLOCKLIST_H)
++              pfilter_notify(result, client, "updateacl");
++#endif
+               dns_name_format(zonename, namebuf, sizeof(namebuf));
+               dns_rdataclass_format(client->view->rdclass, classbuf,
+                                     sizeof(classbuf));
+@@ -393,6 +403,9 @@ checkupdateacl(ns_client_t *client, dns_
+               msg = "disabled";
+       } else {
+               result = ns_client_checkaclsilent(client, NULL, acl, false);
++#if defined(HAVE_BLACKLIST_H) || defined(HAVE_BLOCKLIST_H)
++              pfilter_notify(result, client, "updateacl");
++#endif
+               if (result == ISC_R_SUCCESS) {
+                       level = ISC_LOG_DEBUG(3);
+                       msg = "approved";
Index: pkgsrc/net/bind918/patches/patch-lib_ns_xfrout.c
diff -u /dev/null pkgsrc/net/bind918/patches/patch-lib_ns_xfrout.c:1.1
--- /dev/null   Sun Dec 11 01:57:55 2022
+++ pkgsrc/net/bind918/patches/patch-lib_ns_xfrout.c    Sun Dec 11 01:57:55 2022
@@ -0,0 +1,33 @@
+$NetBSD: patch-lib_ns_xfrout.c,v 1.1 2022/12/11 01:57:55 sekiya Exp $
+
+* Based on NetBSD, add support for blocklist(blacklist).
+
+--- lib/ns/xfrout.c.orig       2020-12-07 08:16:53.000000000 +0000
++++ lib/ns/xfrout.c
+@@ -44,6 +44,10 @@
+ #include <ns/stats.h>
+ #include <ns/xfrout.h>
+ 
++#if defined(HAVE_BLACKLIST_H) || defined(HAVE_BLOCKLIST_H)
++#include <ns/pfilter.h>
++#endif
++
+ /*! \file
+  * \brief
+  * Outgoing AXFR and IXFR.
+@@ -818,9 +822,15 @@ ns_xfr_start(ns_client_t *client, dns_rd
+                                             ISC_LOG_ERROR,
+                                             "zone transfer '%s/%s' denied",
+                                             _buf1, _buf2);
++#if defined(HAVE_BLACKLIST_H) || defined(HAVE_BLOCKLIST_H)
++                              pfilter_notify(result, client, "zonexfr");
++#endif
+                               goto failure;
+                       }
+                       if (result != ISC_R_SUCCESS) {
++#if defined(HAVE_BLACKLIST_H) || defined(HAVE_BLOCKLIST_H)
++                              pfilter_notify(result, client, "zonexfr");
++#endif
+                               FAILQ(DNS_R_NOTAUTH, "non-authoritative zone",
+                                     question_name, question_class);
+                       }



Home | Main Index | Thread Index | Old Index