This is a discussion on Re: strange interpretation of IP address within the mailing.openbsd.tech forums, part of the OpenBSD category; --> On 12/27/07, Ivan Solonin <iss@e-sky.ru> wrote: > # ping 192.168.025.11 > PING 192.168.025.11 (192.168.21.11): 56 data bytes > --- ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| On 12/27/07, Ivan Solonin <iss@e-sky.ru> wrote: > # ping 192.168.025.11 > PING 192.168.025.11 (192.168.21.11): 56 data bytes > --- 192.168.025.11 ping statistics --- > 11 packets transmitted, 0 packets received, 100.0% packet loss > # > > I think, that 025 interpreted as octal number, but not decimal like > other octets of address. > > It is correct behaviour or bug? Well, that behaviour is based on inet_aton(). If you read http://www.openbsd.org/cgi-bin/man.cgi?query=inet_aton closely you see """"All numbers supplied as ``parts'' in a dot notation may be decimal, oc- tal, or hexadecimal, as specified in the C language (i.e., a leading 0x or 0X implies hexadecimal; a leading 0 implies octal; otherwise, the num- ber is interpreted as decimal).""" Which is surprising if you don't have C in your bones so that you expect C-ish behaviour everywhere. To people who do know C that well, though, to do anything *but* interpret IP addresses like this would be surprising. -Nick |
| Thread Tools | |
| Display Modes | |
|
|