From nobody Tue Apr 28 19:38:20 2026 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4g4rMP4mdCz6c0nf for ; Tue, 28 Apr 2026 19:38:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4g4rMP3LTTz48BQ for ; Tue, 28 Apr 2026 19:38:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1777405105; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uaHcAebDoJI8fOXpOmNUl46y11JwuRM9BvmEJo2x2HI=; b=MzsxM+3VgjgEQ9pTOJuJPn1ksBTC6K1xaUNYxwEtpE0pimRjsYx9PSBtbyKMAioofwJUoq UOy2/qe0RrHsq3Q2wnD8oGpoFSHcLQt2X6Eoz1gLXQ0uoL68+Al2WQYB8O4QcKOYgkRUEj cpR3uPYFazBYXdWXoyblJD52PIoBHXWYj81AzXHBDaPLAdDT7BvtjGHDVmA7y49sqDZDji MJoWY/YokbJSTVamjBUB2h6GqgKEpGsG+yr79e4SYRZNiCKSdkDKZWrP6yw2QwFsC5A0O2 IypJ1KX9Ykt6H1SYb0wHB0YdoAyHbNqZrVC0wAZ5oCusG78/cgyu/SpdINROiw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1777405105; a=rsa-sha256; cv=none; b=YD5RkIrCMGTkGxMa9BLrWkV5Hi1ACKa6Gf5wCSqIleq6a5F6v15uaJ61Az6GEb1AJHe/Xw yWadqQWKDznWq4bOh2CbvNqJ8zbh+GYSy6hyPBee9TaWHlAElIvx5Vum9uQqq0hXX1godg irJEE0MmsWUBESdaDVcHAvpLTkZi+1M+w7Y24sCWgVEkifZ15JNhzVBLRi8ObyK8nqFjSh fTNuFDHHm2+1shgqXyJ0wcRvTPRRpMhptT4lLErF79JtvgujrLOOhvzbYwTO64RmYyQIpl 40nR9NT9ySuwvyMDv9O8y4yPM447ikF2U/T6sgRCuI1RMmTXmw858txDFznSKw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1777405105; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uaHcAebDoJI8fOXpOmNUl46y11JwuRM9BvmEJo2x2HI=; b=P0w1AAsz+GmfORC4+8kkk9zYXoyclQXNH26af+Jqhur8GIRsDq6SC12Im5G/VrMkfOBcmP 9ent5depBsiKAu/KWe+n0dRlC7tLoGrYwHAA381ZqDeMqy+R+nxmHn8yHwGYIRtIEZlO16 TUmzI+NjatGZwJGviALnkvYnunx1sQpWIAYh24v7vpE8l9iq5a87p3ZAMQRi14jdazDSmg bSoAZfJQyICkq7BrKhaUZWnOvBtLNqggEtmEamMJrBlMrCxPKEZItVcgp2z1zrpyqqQkx3 qFqU5v+3Ax2Cb/p6hO0e2D7d3lVJBuwtb4pPQRceA3xqs4VtzwP20GZEBZLk1A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4g4rMP2gLKz16Hn for ; Tue, 28 Apr 2026 19:38:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 32d91 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 28 Apr 2026 19:38:20 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Siva Mahadevan Subject: git: cb0e3a5fba5f - main - contrib/openresolv: MFV openresolv 3.17.4 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: siva X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cb0e3a5fba5fe48607db8c1042bfe6a1164e0db7 Auto-Submitted: auto-generated Date: Tue, 28 Apr 2026 19:38:20 +0000 Message-Id: <69f10cac.32d91.6f38f8d4@gitrepo.freebsd.org> The branch main has been updated by siva: URL: https://cgit.FreeBSD.org/src/commit/?id=cb0e3a5fba5fe48607db8c1042bfe6a1164e0db7 commit cb0e3a5fba5fe48607db8c1042bfe6a1164e0db7 Merge: e139a49b5d8e 43ade7d9e917 Author: Siva Mahadevan AuthorDate: 2026-04-28 19:25:49 +0000 Commit: Siva Mahadevan CommitDate: 2026-04-28 19:26:59 +0000 contrib/openresolv: MFV openresolv 3.17.4 Reviewed by: pfg Approved by: lwhsu (mentor) Differential Revision: https://reviews.freebsd.org/D56269 contrib/openresolv/LICENSE | 2 +- contrib/openresolv/Makefile | 54 +- contrib/openresolv/README.md | 9 +- contrib/openresolv/avahi-daemon.in | 32 ++ contrib/openresolv/configure | 4 +- contrib/openresolv/dnsmasq.in | 8 +- contrib/openresolv/libc.in | 82 ++- contrib/openresolv/mdnsd.in | 32 ++ contrib/openresolv/named.in | 4 +- contrib/openresolv/pdns_recursor.in | 4 +- contrib/openresolv/pdnsd.in | 10 +- contrib/openresolv/resolvconf.8.in | 226 +++++--- contrib/openresolv/resolvconf.conf.5.in | 182 ++++-- contrib/openresolv/resolvconf.in | 947 +++++++++++++++++++++++++------- contrib/openresolv/resolvectl.in | 159 ++++++ contrib/openresolv/systemd-resolved.in | 96 ++++ contrib/openresolv/unbound.in | 30 +- 17 files changed, 1484 insertions(+), 397 deletions(-) diff --cc contrib/openresolv/Makefile index 6cfa6e4ea072,000000000000..ba9a75d35f22 mode 100644,000000..100644 --- a/contrib/openresolv/Makefile +++ b/contrib/openresolv/Makefile @@@ -1,118 -1,0 +1,138 @@@ +PKG= openresolv + +# Nasty hack so that make clean works without configure being run +_CONFIG_MK!= test -e config.mk && echo config.mk || echo config-null.mk +CONFIG_MK?= ${_CONFIG_MK} +include ${CONFIG_MK} + ++DIST!= if test -d .git; then echo "dist-git"; \ ++ else echo "dist-inst"; fi ++ +SBINDIR?= /sbin +SYSCONFDIR?= /etc +LIBEXECDIR?= /libexec/resolvconf +VARDIR?= /var/run/resolvconf + +ECHO?= echo +INSTALL?= install +SED?= sed + +VERSION!= ${SED} -n 's/OPENRESOLV_VERSION="\(.*\)".*/\1/p' resolvconf.in + +BINMODE?= 0755 +DOCMODE?= 0644 +MANMODE?= 0444 + - RESOLVCONF= resolvconf resolvconf.8 resolvconf.conf.5 - SUBSCRIBERS= libc dnsmasq named pdnsd pdns_recursor unbound - TARGET= ${RESOLVCONF} ${SUBSCRIBERS} ++RESOLVCONF= resolvconf resolvconf.8 resolvconf.conf.5 ++SUBSCRIBERS= libc dnsmasq named pdnsd pdns_recursor unbound ++SUBSCRIBERS+= systemd-resolved resolvectl ++LIBC_SUBSCRIBERS= avahi-daemon mdnsd ++TARGET= ${RESOLVCONF} ${SUBSCRIBERS} ${LIBC_SUBSCRIBERS} +SRCS= ${TARGET:C,$,.in,} # pmake +SRCS:= ${TARGET:=.in} # gmake + +SED_SBINDIR= -e 's:@SBINDIR@:${SBINDIR}:g' +SED_SYSCONFDIR= -e 's:@SYSCONFDIR@:${SYSCONFDIR}:g' +SED_LIBEXECDIR= -e 's:@LIBEXECDIR@:${LIBEXECDIR}:g' +SED_VARDIR= -e 's:@VARDIR@:${VARDIR}:g' +SED_RCDIR= -e 's:@RCDIR@:${RCDIR}:g' +SED_RESTARTCMD= -e 's:@RESTARTCMD@:${RESTARTCMD}:g' +SED_RCDIR= -e 's:@RCDIR@:${RCDIR}:g' +SED_STATUSARG= -e 's:@STATUSARG@:${STATUSARG}:g' + +DISTPREFIX?= ${PKG}-${VERSION} - DISTFILEGZ?= ${DISTPREFIX}.tar.gz +DISTFILE?= ${DISTPREFIX}.tar.xz +DISTINFO= ${DISTFILE}.distinfo - DISTINFOSIGN= ${DISTINFO}.asc - CKSUM?= cksum -a SHA256 - PGP?= netpgp ++DISTINFOMD= ${DISTINFO}.md ++DISTSIGN= ${DISTFILE}.asc ++SHA256?= sha256 ++PGP?= gpg2 + +GITREF?= HEAD + +.SUFFIXES: .in + +all: ${TARGET} + +.in: Makefile ${CONFIG_MK} + ${SED} ${SED_SBINDIR} ${SED_SYSCONFDIR} ${SED_LIBEXECDIR} \ + ${SED_VARDIR} \ + ${SED_RCDIR} ${SED_RESTARTCMD} ${SED_RCDIR} ${SED_STATUSARG} \ + $< > $@ + +clean: + rm -f ${TARGET} + +distclean: clean - rm -f config.mk ${DISTFILE} ${DISTINFO} ${DISTINFOSIGN} ++ rm -f config.mk ${DISTFILE} ${DISTINFO} ${DISTINFOMD} ${DISTSIGN} + +installdirs: + +proginstall: ${TARGET} + ${INSTALL} -d ${DESTDIR}${SBINDIR} + ${INSTALL} -m ${BINMODE} resolvconf ${DESTDIR}${SBINDIR} + ${INSTALL} -d ${DESTDIR}${SYSCONFDIR} + test -e ${DESTDIR}${SYSCONFDIR}/resolvconf.conf || \ + ${INSTALL} -m ${DOCMODE} resolvconf.conf ${DESTDIR}${SYSCONFDIR} + ${INSTALL} -d ${DESTDIR}${LIBEXECDIR} + ${INSTALL} -m ${DOCMODE} ${SUBSCRIBERS} ${DESTDIR}${LIBEXECDIR} ++ ${INSTALL} -d ${DESTDIR}${LIBEXECDIR}/libc.d ++ ${INSTALL} -m ${DOCMODE} ${LIBC_SUBSCRIBERS} \ ++ ${DESTDIR}${LIBEXECDIR}/libc.d + +maninstall: + ${INSTALL} -d ${DESTDIR}${MANDIR}/man8 + ${INSTALL} -m ${MANMODE} resolvconf.8 ${DESTDIR}${MANDIR}/man8 + ${INSTALL} -d ${DESTDIR}${MANDIR}/man5 + ${INSTALL} -m ${MANMODE} resolvconf.conf.5 ${DESTDIR}${MANDIR}/man5 + +install: proginstall maninstall + +dist-git: + git archive --prefix=${DISTPREFIX}/ ${GITREF} | xz >${DISTFILE} + +dist-inst: + mkdir /tmp/${DISTPREFIX} + cp -RPp * /tmp/${DISTPREFIX} + (cd /tmp/${DISTPREFIX}; make clean) - tar -cvjpf ${DISTFILE} -C /tmp ${DISTPREFIX} ++ tar -cvJpf ${DISTFILE} -C /tmp ${DISTPREFIX} + rm -rf /tmp/${DISTPREFIX} + - dist: dist-git ++dist: ${DIST} + +distinfo: dist - rm -f ${DISTINFO} ${DISTINFOSIGN} - ${CKSUM} ${DISTFILE} >${DISTINFO} - #printf "SIZE (${DISTFILE}) = %s\n" $$(wc -c <${DISTFILE}) >>${DISTINFO} - ${PGP} --clearsign --output=${DISTINFOSIGN} ${DISTINFO} - chmod 644 ${DISTINFOSIGN} - ls -l ${DISTFILE} ${DISTINFO} ${DISTINFOSIGN} ++ rm -f ${DISTINFO} ${DISTSIGN} ++ ${SHA256} ${DISTFILE} >${DISTINFO} ++ wc -c <${DISTFILE} \ ++ | xargs printf 'Size (${DISTFILE}) = %s\n' >>${DISTINFO} ++ ${PGP} --sign --armour --detach ${DISTFILE} ++ chmod 644 ${DISTSIGN} ++ ls -l ${DISTFILE} ${DISTINFO} ${DISTSIGN} ++ ++${DISTINFOMD}: ${DISTINFO} ++ echo '```' >${DISTINFOMD} ++ cat ${DISTINFO} >>${DISTINFOMD} ++ echo '```' >>${DISTINFOMD} ++ ++release: distinfo ${DISTINFOMD} ++ gh release create v${VERSION} \ ++ --title "openresolv ${VERSION}" --draft --generate-notes \ ++ --notes-file ${DISTINFOMD} \ ++ ${DISTFILE} ${DISTSIGN} + +import: dist + rm -rf /tmp/${DISTPREFIX} + ${INSTALL} -d /tmp/${DISTPREFIX} + tar xvJpf ${DISTFILE} -C /tmp + +_import-src: + rm -rf ${DESTDIR}/* + ${INSTALL} -d ${DESTDIR} + cp LICENSE README.md ${SRCS} resolvconf.conf ${DESTDIR}; + cp resolvconf.8.in resolvconf.conf.5.in ${DESTDIR}; + @${ECHO} + @${ECHO} "=============================================================" + @${ECHO} "openresolv-${VERSION} imported to ${DESTDIR}" + +import-src: - ${MAKE} _import-src DESTDIR=`if [ -n "${DESTDIR}" ]; then echo "${DESTDIR}"; else echo /tmp/${DISTPREFIX}; fi` ++ ${MAKE} _import-src DESTDIR=`if [ -n "${DESTDIR}" ]; then echo "${DESTDIR}"; else echo /tmp/${DISTPREFIX}; fi` diff --cc contrib/openresolv/README.md index 739cc73356cb,000000000000..50e54ced93ef mode 100644,000000..100644 --- a/contrib/openresolv/README.md +++ b/contrib/openresolv/README.md @@@ -1,64 -1,0 +1,69 @@@ +# openresolv + +openresolv is a [resolvconf](https://en.wikipedia.org/wiki/Resolvconf) +implementation which manages `/etc/resolv.conf`. + +`/etc/resolv.conf` is a file that holds the configuration for the local +resolution of domain names. +Normally this file is either static or maintained by a local daemon, +normally a DHCP daemon. But what happens if more than one thing wants to +control the file? +Say you have wired and wireless interfaces to different subnets and run a VPN +or two on top of that, how do you say which one controls the file? +It's also not as easy as just adding and removing the nameservers each client +knows about as different clients could add the same nameservers. + +Enter resolvconf, the middleman between the network configuration services and +`/etc/resolv.conf`. +resolvconf itself is just a script that stores, removes and lists a full +`resolv.conf` generated for the interface. It then calls all the helper scripts +it knows about so it can configure the real `/etc/resolv.conf` and optionally +any local nameservers other than libc. + +## Reasons for using openresolv + +Why openresolv over the +[Debian implementation](http://qref.sourceforge.net/Debian/reference/ch-gateway.en.html#s-dns-resolvconf)? +Here's some reasons: + * Works with + [POSIX shell and userland](http://www.opengroup.org/onlinepubs/009695399) + * Does not need awk, grep or sed which means we can work without `/usr` + mounted + * Works with other init systems than Debians' out of the box + * Available as a 2 clause + [BSD license](http://www.freebsd.org/copyright/freebsd-license.html) + * Prefer configs via IF_METRIC for dynamic ordering + * Configures zones for local resolvers other than libc + +The last point is quite important, especially when running VPN systems. +Take the following resolv.conf files which have been generated by a - [DHCP client](../dhcpcd) and sent to resolvconf: ++[DHCP client](https://github.com/NetworkConfiguration/dhcpcd) and sent to resolvconf: + +``` +# resolv.conf from bge0 +search foo.com +nameserver 1.2.3.4 + +# resolv.conf from tap0 +domain bar.org +nameserver 5.6.7.8 +``` + +In this instance, queries for foo.com will go to 1.2.3.4 and queries for +bar.org will go to 5.6.7.8. +This does require the resolvers to be configured to pickup the resolvconf +generated configuration for them though. +openresolv ships with helpers for: + * [unbound](http://www.unbound.net/) + * [dnsmasq](http://www.thekelleys.org.uk/dnsmasq/doc.html) + * [ISC BIND](http://www.isc.org/software/bind) + * [PowerDNS Recursor](http://wiki.powerdns.com/trac) ++ * [systemd-resolved](https://www.freedesktop.org/software/systemd/man/latest/systemd-resolved.service.html) + +See the - [configuration section](https://roy.marples.name/projects/openresolv/config) ++[configuration section](https://roy.marples.name/projects/openresolv/configuration) +for more details. ++ ++If openresolv updates `/etc/resolv.conf` it can notify the following of this: ++ * [Bonjour (mdnsd)](https://developer.apple.com/bonjour/) ++ * [avahi](http://www.avahi.org/) diff --cc contrib/openresolv/avahi-daemon.in index 000000000000,cdac44fe8234..cdac44fe8234 mode 000000,100644..100644 --- a/contrib/openresolv/avahi-daemon.in +++ b/contrib/openresolv/avahi-daemon.in diff --cc contrib/openresolv/configure index c9422b74b69c,50fe74da8baa..50fe74da8baa mode 100644,100755..100755 --- a/contrib/openresolv/configure +++ b/contrib/openresolv/configure diff --cc contrib/openresolv/mdnsd.in index 000000000000,3b01cd459f16..3b01cd459f16 mode 000000,100644..100644 --- a/contrib/openresolv/mdnsd.in +++ b/contrib/openresolv/mdnsd.in diff --cc contrib/openresolv/resolvectl.in index 000000000000,167aac62ba57..167aac62ba57 mode 000000,100644..100644 --- a/contrib/openresolv/resolvectl.in +++ b/contrib/openresolv/resolvectl.in diff --cc contrib/openresolv/systemd-resolved.in index 000000000000,0190a73723e5..0190a73723e5 mode 000000,100644..100644 --- a/contrib/openresolv/systemd-resolved.in +++ b/contrib/openresolv/systemd-resolved.in