Unix Technical Forum

Re: strange interpretation of IP address

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 > --- ...


Go Back   Unix Technical Forum > Unix Operating Systems > OpenBSD > mailing.openbsd.tech

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-18-2008, 09:34 AM
Nick Guenther
 
Posts: n/a
Default Re: strange interpretation of IP address

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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 11:35 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com