I took a look
here rejetto, and it seems altough there are many special IPs only the three I mentioned are actually reserved for
private purposes. All other "Reserved" may change in the future.
The link above is the
RFC1918, it's the reference one should follow I think...
I quote excerpt:
3. Private Address Space
The Internet Assigned Numbers Authority (IANA) has reserved the
following three blocks of the IP address space for private internets:
10.0.0.0 - 10.255.255.255 (10/8 prefix)
172.16.0.0 - 172.31.255.255 (172.16/12 prefix)
192.168.0.0 - 192.168.255.255 (192.168/16 prefix)
We will refer to the first block as "24-bit block", the second as
"20-bit block", and to the third as "16-bit" block. Note that (in
pre-CIDR notation) the first block is nothing but a single class A
network number, while the second block is a set of 16 contiguous
class B network numbers, and third block is a set of 256 contiguous
class C network numbers.
I found no error in your formula, but I don't know what these "special" reserved IPs are for. What I know is that if your server is hit by one of the three ranges above + the APIPA one, it is
definately a local address (including 127.0.0.1 aka localhost). But I'm no expert.
Edit: found another
linkMarkV