Re: Strange input/cast semantics for inet - Mailing list pgsql-general

From Michael Fuhr
Subject Re: Strange input/cast semantics for inet
Date
Msg-id 20050722032655.GA86855@winnie.fuhr.org
Whole thread Raw
In response to Re: Strange input/cast semantics for inet  (Greg Stark <gsstark@mit.edu>)
List pgsql-general
On Thu, Jul 21, 2005 at 10:14:42PM -0400, Greg Stark wrote:
> Michael Fuhr <mike@fuhr.org> writes:
>
> > I don't know if it's ever been blessed by a formal standard
>
> It's blessed by POSIX:
>
> http://www.opengroup.org/onlinepubs/009695399/functions/inet_addr.html

Yep, that's lifted almost verbatim out of the 4.2BSD inet(3) manual
page.

> I'm really skeptical Vixie would have written things this way. Perhaps
> somebody at some point later misunderstood the convention and "fixed" the
> behaviour?

I just ran some tests with the inet_net_pton() function found in
the BIND 4.9.11 source code and it behaves the same way as the code
in PostgreSQL, viz., 10.1 becomes 10.1.0.0.  The code I used had
the following rcsid:

$Id: inet_net_pton.c,v 8.3 1996/11/11 06:36:52 vixie Exp $

Maybe Vixie didn't like the convention or think it was worth
implementing for his needs.

Aside from the rare use of "ping 127.1", I do find it more useful
to interpret 10.1 as 10.1.0.0 since I'm more likely to use 10.1 as
an abbreviation for the "ten dot one network" than as shorthand for
10.0.0.1.  I expect I'm not alone in that.

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

pgsql-general by date:

Previous
From: Greg Stark
Date:
Subject: Re: Strange input/cast semantics for inet
Next
From: Benjamin Smith
Date:
Subject: Dumb question about count()