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



On Fri, Jun 09, 2023 at 09:39:11PM -0700, Seth David Schoen wrote:
> 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);
> 

Looks good to me (including pullup to all active branches).

Should we also remove the definition of IN_EXPERIMENTAL from netinet/in.h,
at least in -current and see what 3rd party fallout it causes (I would
expect: close to zero or zero)?

Martin


Home | Main Index | Thread Index | Old Index