non operational question related to IP

Mark Andrews marka at isc.org
Mon Nov 22 23:16:11 UTC 2010


See man inet.

     All numbers supplied as ``parts'' in a `.' notation may be decimal,
     octal, or hexadecimal, as specified in the C language (i.e., a leading 0x
     or 0X implies hexadecimal; otherwise, a leading 0 implies octal; other-
     wise, the number is interpreted as decimal).

Note: inet_pton is supposed to only take dotted decimal quad (no
leading zeros).  This was a design decision Paul and I made at the
time.  Some OS vendors have incorrectly extended it.

Mark

In message <0A3857A2-B215-4592-A288-A534D460CEE7 at oicr.on.ca>, Greg Whynott writ
es:
> 
> i was pinging a host from a windows machine and made a typo which seemed ha=
> rmless.  the end result was it interpreted my input differently than what I=
>  had intended.   thinking this was a m$ issue I quickly took the opportunit=
> y to poke fun at windows as the senior m$ admin was near by.
> 
> "look at how brain dead this os is,  it can't even do simple math!"
> 
> He is now looking at my screen scratching his head=85..
> 
> "watch,  i'll open a shell on os x and show you how it can add 0 +10"
> 
> I open a shell on os x,  same behavior as windows.
> 
> " ok so apple is brain dead too,  watch,  it'll work on linux!"
> 
> same deal=85
> 
> 
> long story short,  it does work as expected on all our hardware routing gea=
> r.    still not sure what is happening here=85
> 
> 
> osx-gwhynott:~ gwhynott$ ping 10.010.10.1
> PING 10.010.10.1 (10.8.10.1): 56 data bytes
> 
> 
> gwhynott at ops:~$ ping 10.010.10.1
> PING 10.010.10.1 (10.8.10.1) 56(84) bytes of data.
> 
> 
> CORE1>ping 10.010.10.1
> Type escape sequence to abort.
> Sending 5, 100-byte ICMP Echos to 10.10.10.1, timeout is 2 seconds:
> !!!!!
> 
> 
> anyone happen to know how the OS's are interpreting the 010?   doesn't appe=
> ar work out in base[2-10] (1010,101,22,20,14,13,12,11,10,A)
> 
> 
> thanks!
> 
> greg
> 
> 
> 
> 
> 
> --
> 
> This message and any attachments may contain confidential and/or privileged=
>  information for the sole use of the intended recipient. Any review or dist=
> ribution by anyone other than the person for whom it was originally intende=
> d is strictly prohibited. If you have received this message in error, pleas=
> e contact the sender and delete all copies. Opinions, conclusions or other =
> information contained in this message may not be that of the organization.
> 
-- 
Mark Andrews, ISC
1 Seymour St., Dundas Valley, NSW 2117, Australia
PHONE: +61 2 9871 4742                 INTERNET: marka at isc.org




More information about the NANOG mailing list