use of #ifdef INET and #ifdef INET6 in the kernel sources
Rick Macklem
rmacklem at uoguelph.ca
Fri Mar 1 02:57:15 UTC 2019
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.
>> 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.
>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
More information about the freebsd-net
mailing list