Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 1 Mar 2019 04:19:46 -0800 (PST)
From:      "Rodney W. Grimes" <freebsd-rwg@pdx.rh.CN85.dnsmgr.net>
To:        Rick Macklem <rmacklem@uoguelph.ca>
Cc:        "Bjoern A. Zeeb" <bz@freebsd.org>, FreeBSD Net <freebsd-net@freebsd.org>,  "rgrimes@freebsd.org" <rgrimes@freebsd.org>
Subject:   Re: use of #ifdef INET and #ifdef INET6 in the kernel sources
Message-ID:  <201903011219.x21CJkIE061223@pdx.rh.CN85.dnsmgr.net>
In-Reply-To: <QB1PR01MB3537DB5BF5EE01C6006B3090DD760@QB1PR01MB3537.CANPRD01.PROD.OUTLOOK.COM>

next in thread | previous in thread | raw e-mail | index | archive | help
> Bjoern A. Zeeb wrote:
> [stuff snipped]
> I wrote:
> >> So, is this still recommended for blocks of code that only execute for
> >> the version
> >> of IP, but will build for kernels that do not have the particular
> >> "options INET{6}"
> >> in the kernel config?
> >
> >Yes.
> Ok, I'll do it.
Thank you 

> >> If it is still recommended, I will do it, but I'll admit I don't
> >> understand why it should
> >> be done? (All it does is reduce the size of the executable by a small
> >> amount and
> >> that doesn't seem significant to me.)
> >
> >That small amount is still relevant on some devices where people go to
> >great lengths to fit our constantly growing base into a tiny small
> >thingy.
> I doubt NFS gets squeezed into such devices and, yes, it is a small amount.
> Using source line counts via "wc" (ir includes comments, etc):
> - This will reduce the # of lines by about 6 for a module of about 7700  lines
>    which is loaded when either the nfscl or nfsserver modules are loaded.
>    (These are both about 25000 lines and require the krpc, which is another 10000.
>      I haven't included the Kerberos stuff, because I can't remember if that gets loaded
>      unless Kerberos mounts get used.)
> --> A savings of 6 lines in something like 43000.

That means that nfsusrd is an extremly well behaved ipv4/ipv6
agnostic deamon that only takes a small change to make it able
to run as either v4/v6 as a single stack or dual stacked, at a cost
that also sounds minial, even if it took an #ifdef for each of these
lines that is only 6 in 43000 lines of code, which is a small cost.

The same analysis on other code probably comes out no place near
this.

Also didnt this use to use a unix domain?  Could the unix domain
be put back and knobbed so that I could actually run this without
it doing the localnet thing at all?  I know that it had issues
as the socket is in /tmp and if /tmp isnt a right type file system,
etc...  But some of us do know that and do run with a /tmp that
would support AF_UNIX type nfsusrd.

If it takes 6 lines of ifdef to do v4 vs v6, how many lines of
ifdef is it to add AF_UNIX back and make it run time choice?

(Goes looking for more Nomex clothing :-)

> >And it allows you to lose code from your kernel that you don?t
> >need/want, such as if you?d want to rip out all INET sources from a
> >tree.
> Ok, I can buy into this argument. I doubt I'll see IPv4 removed in my lifetime, but
> it does document where the code is.
> (In Canada, network providers only give out IPv4 addresses to end users, from
>  what I've seen.)
> 
> >I know both of these groups still do exist.
> >
> >Also every code not compiled in is not an attack surface, where you
> >think it?s executed or not.
> 
> rick
-- 
Rod Grimes                                                 rgrimes@freebsd.org



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201903011219.x21CJkIE061223>