tech-net archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Support for 240/4 and 0/8 addresses in NetBSD



I went and gathered some background information.

1) 0.0.0.0/8 is reserved by IANA because it is mentioned in RFC791 section 3.2 which in turn points us to RFC 791. 0.0.0.0/8 is used for network discovery by ICMP message code 15 (ICMP_IREQ). The network discovery function described in the RFC has been unusable since 1993 because it doesn't account for netmasks.

This ICMP message and its reply are not implemented in the NetBSD kernel.

2) 90% of the references to IN_CLASS* in the NetBSD kernel are related to testing for localhost addresses. Since the localhost network has always had an explicit /8 netmask and was never defined as a class A network, one can argue that even though the numbers work out correctly, the words are wrong. We should be using IN_LOCALHOST* when working with the localhost network. In fact it would probably suffice for us to have an IN_LOCALHOST(x) macro that works a lot like the IN_CLASSA(x) macro.

I think I'll send in a PR with a patch for IN_LOCALHOST(x) in the next few days.

Cheers,
Lloyd

On 14/06/23 00:16, Martin Husemann wrote:
On Mon, Jun 12, 2023 at 10:25:27AM -0400, Mouse wrote:
I think that is what we are landing on; there have been several
comments (including me) that we shouldn't change given the lack of
standardization, and I haven't seen any in favor of just changing.

Depending on your opinion of me, it may be a reason to change or a
reason to not change, but I'm in favour of just changing.

Me too. A sysctl is slightly expensive (at various scales) and IMHO
simply not needed here. A kernel config option to restore the old
behaviour would be OK, but I'd like to avoid that too.

I have never seen IN_EXPERIMENTAL used anywhere and (on a tangent) I am
actually suprised that we still have code using IN_CLASS* in tree (but
too lazy to actually check the code and see if its hidden behind some
#ifdef that is off for our usual builds).

Martin


Home | Main Index | Thread Index | Old Index