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

Do we compile it for NOIP?

-- 
Gleb Smirnoff