i have a problem with the Windows utillity PING.
if i try to ping an ip-adress (i.e 10.10.10.10) everything works
correct: the host with the ip adress 10.10.10.10 answers.
now i try to ping the adress 10.10.10.010 -> this should be the same
host as the one mentioned above. But in this case the host with the
ip-adress 10.10.10.8 (!!!) answers!
My Question: what is the difference between 10.10.10.10 and
10.10.10.010?
This problem appears with multiple ip-adresses: have a try?
Thx,
Chris
Numbers starting with '0' are interpreted as octal numbers (base 8)
rather than decimal numbers (base 10). '10' is the octal representation
for decimal '8'. So 0377 corresponds to 255 decimal, etc.
Greetings,
Johan
--
Why do we always come here - I guess we'll never know.
It's like a kind of torture to have to watch the show.
The 0 is causing the last octet to be read in octal (base-8) where 010
is decimal 8. This bites everyone at one time, and baffles
non-programmers. Don't use leading 0's and you'll be fine.
cheers,
BM
(snip)
> now i try to ping the adress 10.10.10.010 -> this should be the same
> host as the one mentioned above. But in this case the host with the
> ip-adress 10.10.10.8 (!!!) answers!
And you can put a 0x prefix on hex numbers.
Also, there are rules for dotted IP addresses with fewer than
four components, including writing the whole thing as a
single 32 bit number. 0x0a0a0a0a will also find your
10.10.10.10 server, as will 10.10.2570, 10.0xa0a0a
and 0xa.657930 and 10.02405012
-- glen