Re: git: f0a861efbafe - main - local-unbound-setup: Support IPv6-only systems

From: Shawn Webb <shawn.webb_at_hardenedbsd.org>
Date: Sat, 27 Jun 2026 17:51:02 UTC
On Sat, Jun 27, 2026 at 05:34:46PM +0000, Alexey Dokuchaev wrote:
> On Sat, Jun 27, 2026 at 05:15:55PM +0000, Shawn Webb wrote:
> > On Fri, Jun 26, 2026 at 06:33:18PM +0000, Shawn Webb wrote:
> > > On Fri, Jun 26, 2026 at 02:43:37PM +0000, Dag-Erling Sm?rgrav wrote:
> > > > commit f0a861efbafeb81428d5e8c23dac9da73fe14007
> > > > [...]
> > > > +#
> > > > +# Check if a kernel feature is available
> > > > +#
> > > > +has_feature() {
> > > > +	local name=$1 v
> > > > +	eval "v=\$kern_features_${name}"
> > > > +	if [ -z "$v" ] ; then
> > > > +		v="$(sysctl -qn "kern.features.${name}")"
> > > > +		eval "kern_features_${name}=$((v))"
> > > > +	fi
> > > > +	return $((!v))
> > > > +}
> > > 
> > > The function above seems like it might be useful outside the context
> > > of local-unbound. I'm wondering if this would be a better fit for
> > > libexec/rc/rc.subr.
> > 
> > Ah, I partially misread the commit. Nevermind about the question above.
> 
> Could you explain?  This still looks like a useful function to have
> outside the context of local-unbound.

rc.subr has a function called check_kern_features that operates in a
similar fashion. I suspect the two implementations could probably be
unified, but that would probably be orthogonal to this particular
commit.

I suspect a discussion of maintaining a library of useful shell script
functions outside the context of both rc and local-unbound could be
had. I'm pretty sure there's quite a few paint buckets at the ready to
paint this particular bike shed. ;-)

Thanks,

-- 
Shawn Webb
Cofounder / Security Engineer
HardenedBSD

Signal Username:  shawn_webb.74
Tor-ified Signal: +1 (719) 756-1197 / activist_opsec.27
https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/raw/master/Shawn_Webb/03A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc