Coffin Michael C wrote:
> I had coded the third octet as .035. instead of .35.  VM's TCPIP took the
> 152.225.035.249 without any difficulty.  But all of my Linux/390 guests
> CHANGED the .035. to .29 - so this same address on a Linux/390 guest would
> be 152.225.29.249.  I was totally perplexed, and after hours of scratching
> my head I changed one of these to just .35. and low and behold it worked!

That is definitely a bug in the bit of Linux code that parses
that IP address.
The specs call this notation "dotted decimal", and RFC820 says
"For example, the internet address of ISIF in dotted decimal is
 010.002.000.052, or 10.2.0.52."

So, obviously, 035 should have been interpreted as the decimal
value 35, not as octal 35.

> So my question is why did the Linux/390 guests interpret .035. to mean .29.,
> and if that is a "normal" thing - why didn't VM's TCPIP do the same thing?

The standard Unix/C integer parsing functions "by default" do
automatic detection of the base of the number.  A "0x" prefix
indicates base 16, a "0" prefix indicates base 8, otherwise, base 10.
To parse in a specific base, the desired base must be specified
to the parsing function.
It would appear that some code that parses a "dotted decimal"
IP address has erroneously be written using the default automatic
base detection, where it should have forced base 10.


--
     Willem Konynenberg <[EMAIL PROTECTED]>
I am not able rightly to apprehend the kind of confusion of ideas
that could provoke such a question  --  Charles Babbage

Reply via email to