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 04:04:12 UTC
On Sun, Sep 04, 2022 at 06:39:53AM +0000, Bjoern A. Zeeb wrote:
B> > B> > Author:     Gleb Smirnoff <glebius@FreeBSD.org>
B> > B> > AuthorDate: 2022-08-30 22:09:21 +0000
B> > B> > Commit:     Gleb Smirnoff <glebius@FreeBSD.org>
B> > B> > CommitDate: 2022-08-30 22:09:21 +0000
B> > B> >
B> > B> >    divert(4): make it compilable and working without INET
B> > B> >
B> > B> >    Differential revision:  https://reviews.freebsd.org/D36383
B> > B>
B> > B> Well, almost at least....
B> >
B> > I wonder why LINT-NOINET builds without this??
B> 
B> I wondered the same last night.. I would be good to find out?

Ok, I think that assumption that sysctl parts of divert require
INET were just wrong, that's why LINT-NOINET builds.

With removed dependency on IPFIREWALL (just pushed) I can exclude
INET from my custom kernel and then run:

kyua test -k /usr/tests/sys/netinet6/Kyuafile divert:ipdivert_ip6_output_remote_success 

And it fails! :) But wait a second here. It fails because Python's
scapy module spews warnings on an INET-less kernel:

>>> import scapy.all
netstat: sysctl: net.route.0.2.dump.0 estimate: Address family not supported by protocol family
WARNING: ioctl(SIOCGIFFLAGS) failed on vtnet0 !
WARNING: No IPv4 address found on vtnet0 !
WARNING: ioctl(SIOCGIFFLAGS) failed on lo0 !
WARNING: No IPv4 address found on lo0 !
WARNING: more ioctl(SIOCGIFFLAGS) failed on vtnet0 !
WARNING: more No IPv4 address found on vtnet0 !

Given that tests/sys/netinet6/divert.sh runs this python program
under atf_check control, and the latter fails if controlled
program reports anything to stderr.

So, if you run the test sequence by hand, skipping atf_check,
you would see that the test actually passes. The injected packet
successfully received by the stack and is counted. Thus, divert(4)
compiles and works without INET in kernel.

-- 
Gleb Smirnoff