From: | Michael Fuhr <mike(at)fuhr(dot)org> |
---|---|
To: | Greg Stark <gsstark(at)mit(dot)edu> |
Cc: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL General Discussion <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Strange input/cast semantics for inet |
Date: | 2005-07-22 03:26:56 |
Message-ID: | 20050722032655.GA86855@winnie.fuhr.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Thu, Jul 21, 2005 at 10:14:42PM -0400, Greg Stark wrote:
> Michael Fuhr <mike(at)fuhr(dot)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/
From | Date | Subject | |
---|---|---|---|
Next Message | Benjamin Smith | 2005-07-22 05:09:07 | Dumb question about count() |
Previous Message | Ezequiel Tolnay | 2005-07-22 03:23:17 | Re: Wishlist? |