Skip site navigation (1) Skip section navigation (2)

Re: pgsql: Define INADDR_NONE on Solaris when it's missing.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: pgsql-committers <pgsql-committers(at)postgresql(dot)org>
Subject: Re: pgsql: Define INADDR_NONE on Solaris when it's missing.
Date: 2010-01-28 16:16:06
Message-ID: 15945.1264695366@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-committerspgsql-hackers
Magnus Hagander <magnus(at)hagander(dot)net> writes:
> On Thu, Jan 28, 2010 at 17:04, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> I think what this shows is we should look for a way to avoid using
>> INADDR_NONE.

>> From some more googling
> (http://www.opengroup.org/onlinepubs/000095399/functions/inet_addr.html),
> it says it will return (in_addr_t)(-1), though, so maybe we should
> just move that #ifdef out to some global place?

Given the way that's written, I think we should just compare the result
to (in_addr_t)(-1), and not assume there's any macro provided for that.

However, now that I know the real issue is you're using inet_addr, I
would like to know why you're not using inet_aton instead; or even
better, something that also copes with IPv6.

			regards, tom lane

In response to

Responses

pgsql-hackers by date

Next:From: Simon RiggsDate: 2010-01-28 16:22:10
Subject: Re: Streaming replication, and walsender during recovery
Previous:From: Magnus HaganderDate: 2010-01-28 16:09:35
Subject: Re: pgsql: Define INADDR_NONE on Solaris when it's missing.

pgsql-committers by date

Next:From: Heikki LinnakangasDate: 2010-01-28 19:17:22
Subject: pgsql: Fix crashing bug at the end of recovery in Streaming Replication,
Previous:From: Magnus HaganderDate: 2010-01-28 16:09:35
Subject: Re: pgsql: Define INADDR_NONE on Solaris when it's missing.

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group