Re: git: e72c522858cb - main - divert(4): make it compilable and working without INET

From: Gleb Smirnoff <glebius_at_freebsd.org>
Date: Wed, 07 Sep 2022 16:02:02 UTC
On Wed, Sep 07, 2022 at 09:54:49AM +0000, Bjoern A. Zeeb wrote:
B> On Tue, 6 Sep 2022, Gleb Smirnoff wrote:
B> 
B> > On Sun, Sep 04, 2022 at 06:39:53AM +0000, Bjoern A. Zeeb wrote:
B> > B> > B> > Author:     Gleb Smirnoff <glebius@FreeBSD.org>
B> > B> > B> > AuthorDate: 2022-08-30 22:09:21 +0000
B> > B> > B> > Commit:     Gleb Smirnoff <glebius@FreeBSD.org>
B> > B> > B> > CommitDate: 2022-08-30 22:09:21 +0000
B> > B> > B> >
B> > B> > B> >    divert(4): make it compilable and working without INET
B> > B> > B> >
B> > B> > B> >    Differential revision:  https://reviews.freebsd.org/D36383
B> > B> > B>
B> > B> > B> Well, almost at least....
B> > B> >
B> > B> > I wonder why LINT-NOINET builds without this??
B> > B>
B> > B> I wondered the same last night.. I would be good to find out?
B> >
B> > Ok, I think that assumption that sysctl parts of divert require
B> > INET were just wrong, that's why LINT-NOINET builds.
B> 
B> Not entirely.  It's because sys/netinet/in_proto.c uncodonitionally
B> currently provides _net_inet for the sysctl.
B> The reason for that is that a lot of AF independent sysctls were initially
B> put under inet but are equally used for inet6 or neither in the network stack.
B> 
B> You will need at least #if defined(INET6) || defined(INET)  around the sysctls
B> in divert.c then.
B> 
B> A LINT-NOIP kernel will complain about the missing symbol if we keep compiling
B> divert without INET or INET6 in the kernel:

My goal was not to make divert(4) supported on NOIP kernel. The goal was to make
it supported on NOINET, an IPv6 only kernel. I don't see any value for divert(4)
on a kernel without either stack.

-- 
Gleb Smirnoff