Re: IPV4 addresses on IPV6 machines in pg_hba.conf

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andreas Pflug <pgadmin(at)pse-consulting(dot)de>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, pgsql-patches(at)postgresql(dot)org
Subject: Re: IPV4 addresses on IPV6 machines in pg_hba.conf
Date: 2003-09-05 22:17:11
Message-ID: 22078.1062800231@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Andreas Pflug <pgadmin(at)pse-consulting(dot)de> writes:
> Tom Lane wrote:
>> I thought this was still really messy, so I modified it to use a
>> separate "promote v4 address to v6" subroutine. I've applied the
>> attached patch (plus docs). It's not very well tested since I don't
>> have an IPv6 setup here; please check that it does what you want.
>>
> It SEGVs. Reason is that the memcpy of the promote_v4_to_v6_XXX
> functions assumes that the sockaddr_storage is large enough to hold an
> IPV6 address, which appears to be not true.

Drat. That didn't happen when I forced it through that path here, but
I guess it could if getaddrinfo is trying to be conservative about the
amount of memory in its return value. I'll rework it.

> IMHO the struct needs to be created officially by
> getaddrinfo(), which will lead more or less the the same solution I
> posted previously.

No, we just need to use datastructures that are under our control for
the values that will get passed to rangeSockAddr. A few more lines...

regards, tom lane

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Andreas Pflug 2003-09-05 22:25:15 Re: IPV4 addresses on IPV6 machines in pg_hba.conf
Previous Message Robert Treat 2003-09-05 22:01:14 Re: note on dropped columns in pg_attribute