Re: pgsql: Make RADIUS authentication use pg_getaddrinfo_all() to get

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-committers <pgsql-committers(at)postgresql(dot)org>
Subject: Re: pgsql: Make RADIUS authentication use pg_getaddrinfo_all() to get
Date: 2010-02-03 19:17:29
Message-ID: 9837222c1002031117xa31aa23we14be738e3daa923@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

On Wed, Feb 3, 2010 at 07:22, Magnus Hagander <magnus(at)hagander(dot)net> wrote:
> On Wednesday, February 3, 2010, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> Magnus Hagander <magnus(at)hagander(dot)net> writes:
>>> On Wednesday, February 3, 2010, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>>>> Perhaps instead of depending on magic constants, you should have the
>>>> code use what "localhost" resolves as, comparably to pgstat.c.
>>
>>> Pgstat only talks locally so that's a completely different thing.
>>
>> Ah, right.
>>
>> I notice that in libpq/ip.c, we're using a macro IN6_IS_ADDR_UNSPECIFIED()
>> as a substitute for testing equality to in6addr_any.  I wonder where
>> that comes from and whether it has a brother for assignment...
>>
>
> I'll take a look. I'm off doing training all day so it won't be until
> tonight though.

Ok. Mingw *does* have inaddr6_any. Only they have it in the headers,
as an extern, but they didn't put it in their libraries. *sigh*

So one thing we could do is to simply define the extern in a #ifdef
section, right there. Which seems rather ugly. Or we can create a new
symbol on mingw and #define or #ifdef it to use that one, like
inaddr6_any_brokenmingw.

From some googling, the value should be:
static in6_addr inaddr6_any={0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0};

Which one seems least ugly?

--
Magnus Hagander
Me: http://www.hagander.net/
Work: http://www.redpill-linpro.com/

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message User Fxjr 2010-02-03 20:43:24 npgsql - Npgsql2: Fixed corrupted files uploaded first time.
Previous Message Bruce Momjian 2010-02-03 17:25:06 pgsql: Proofreading improvements for the Administration documentation