Re: all zeroes/all ones used in host IP's...

From: H. Peter Anvin (hpa@transmeta.com)
Date: Fri Jan 28 2000 - 14:55:20 EST


Followup to: <Pine.LNX.4.10.10001281235040.818-100000@asdf.capslock.lan>
By author: "Mike A. Harris" <mharris@meteng.on.ca>
In newsgroup: linux.dev.kernel
>
> I interpret the above as meaning that it is not legal to have a
> network like this:
>
> 192.168.0.0/24 or 23.0.0.0/24
>
> with hosts 192.168.0.1 through 192.168.0.254 or with hosts
> 23.0.0.1 through 23.0.0.254.
>
> The first zero makes it illegal no? Could someone in the know
> please clarify this as it has been bugging me for some time and
> nobody else seems to be able to say with 100% certainty what the
> proper rule is. Also, would a network like:
>
> 142.255.255.0/24 be illegal?
>
> Someone has suggested that my interpretation is wrong, and if
> that is indeed so, I'd like to know the proper interpretation and
> share it with everyone.
>

You are, indeed, completely wrong. There rules are that neither the
*entire* network portion or the *entire* host portion of the address
can be all 0 or all 1.

In other words:

   ip_addr & netmask != 0
   ip_addr & netmask != netmask
   ip_addr & ~netmask != 0
   ip_addr & ~netmask != ~netmask

    -hpa

-- 
<hpa@transmeta.com> at work, <hpa@zytor.com> in private!
"Unix gives you enough rope to shoot yourself in the foot."

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Jan 31 2000 - 21:00:21 EST