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
Taylor R Campbell writes:
> > Date: Fri, 9 Jun 2023 18:58:54 -0700
> > From: Seth David Schoen <schoen%loyalty.org@localhost>
> >
> > Would you be interested in my patch, or any other references or
> > background, or in discussing this topic further?
>
> Sure, please send the patch and any references for further reading!
Thanks!
Most of the history, reasoning, and implementation status is found in
these two Internet-Drafts:
https://datatracker.ietf.org/doc/draft-schoen-intarea-unicast-240/
https://datatracker.ietf.org/doc/draft-schoen-intarea-unicast-0/
And I don't know if NetBSD patches are just supposed to be inline,
like this:
[the comparison to INADDR_ANY and INADDR_BROADCAST, without endianness
adjustments, may look odd, although these are respectively all zeros
and all ones, so their numerical values can't be changed by endian issues]
diff -r 8e4f9c22f4df sys/netinet/in.c
--- a/sys/netinet/in.c Fri May 26 13:21:51 2023 +0000
+++ b/sys/netinet/in.c Fri Jun 09 21:36:08 2023 -0700
@@ -303,11 +303,11 @@
{
u_int32_t net;
- if (IN_EXPERIMENTAL(in.s_addr) || IN_MULTICAST(in.s_addr))
+ if (in.s_addr == INADDR_BROADCAST || IN_MULTICAST(in.s_addr))
return (0);
if (IN_CLASSA(in.s_addr)) {
net = in.s_addr & IN_CLASSA_NET;
- if (net == 0 || net == htonl(IN_LOOPBACKNET << IN_CLASSA_NSHIFT))
+ if (in.s_addr == INADDR_ANY || net == htonl(IN_LOOPBACKNET << IN_CLASSA_NSHIFT))
return (0);
}
return (1);
Home |
Main Index |
Thread Index |
Old Index