Re: Linux.conf.au 2003 Report

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Kurt Roeckx <Q(at)ping(dot)be>
Cc: Curt Sampson <cjs(at)cynic(dot)net>, Greg Copeland <greg(at)CopelandConsulting(dot)Net>, Andrew Sullivan <andrew(at)libertyrms(dot)info>, PostgresSQL Hackers Mailing List <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Linux.conf.au 2003 Report
Date: 2003-02-02 13:19:23
Message-ID: 200302021319.h12DJNr13516@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-advocacy pgsql-hackers

Kurt Roeckx wrote:
> On Sat, Feb 01, 2003 at 02:35:15PM +0900, Curt Sampson wrote:
> >
> > Sure. But you still want to be able to say (and can say, in some [many?]
> > socket API implementations) that you want to accept only IPv4 or only IPv6
> > connections. I also want to be able to say the same thing in my database.
>
> You just create either an ipv4 or ipv6 socket. And then you can
> bind to an address of that type if you want. Either all
> addresses or a specific one.
>
> Depending on the OS, binding to all addresses on IPv6 will also
> bind to all the ipv4 addresses, which can be both handy an
> annoying. On others you need 2 sockets if you want to listen on
> both ipv4 and ipv6, which makes more sense.

Well, that's interesting. Current CVS only binds to IPv6, and assumes
IPv4 will work too. If some OS's require a separate Ipv4 binding, we
are going to hear about it before 7.4:

---------------------------------------------------------------------------

#ifdef HAVE_IPV6
/* Try INET6 first. May fail if kernel doesn't support IP6 */
status = StreamServerPort(AF_INET6, VirtualHost,
(unsigned short) PostPortNumber,
UnixSocketDir,
&ServerSock_INET);
if (status != STATUS_OK)
{
elog(LOG, "IPv6 support disabled --- perhaps the kernel does not support IPv6");
#endif
status = StreamServerPort(AF_INET, VirtualHost,
(unsigned short) PostPortNumber,
UnixSocketDir,
&ServerSock_INET);
if (status != STATUS_OK)
{
postmaster_error("cannot create INET stream port");
ExitPostmaster(1);
}
#ifdef HAVE_IPV6
else
elog(LOG, "IPv4 socket created");
}
#endif
}

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Responses

Browse pgsql-advocacy by date

  From Date Subject
Next Message Kurt Roeckx 2003-02-02 13:26:59 Re: Linux.conf.au 2003 Report
Previous Message Kurt Roeckx 2003-02-02 12:38:36 Re: Linux.conf.au 2003 Report

Browse pgsql-hackers by date

  From Date Subject
Next Message Kurt Roeckx 2003-02-02 13:26:59 Re: Linux.conf.au 2003 Report
Previous Message Kurt Roeckx 2003-02-02 12:38:36 Re: Linux.conf.au 2003 Report