Re: [PATCHES] IPV4 addresses on IPV6 machines in pg_hba.conf

2003-09-05 Thread Bruce Momjian
Tom Lane wrote: > Bruce Momjian <[EMAIL PROTECTED]> writes: > > Would you like me to conditionally add the IPv6 line to pg_hba.conf from > > initdb now? > > I was going to tackle that tomorrow, but if you wanna do it, go for it. No, go ahead. I wasn't sure if you were waiting for me so I asked.

Re: [PATCHES] IPV4 addresses on IPV6 machines in pg_hba.conf

2003-09-05 Thread Tom Lane
Bruce Momjian <[EMAIL PROTECTED]> writes: > Would you like me to conditionally add the IPv6 line to pg_hba.conf from > initdb now? I was going to tackle that tomorrow, but if you wanna do it, go for it. regards, tom lane ---(end of broadcast)--

Re: [PATCHES] IPV4 addresses on IPV6 machines in pg_hba.conf

2003-09-05 Thread Bruce Momjian
[EMAIL PROTECTED] wrote: > Bruce Momjian said: > > > > Would you like me to conditionally add the IPv6 line to pg_hba.conf > > from initdb now? > > > > As a matter of taste and possibly due to some paranoia I would prefer to > see it added unconditionally to pg_hba.conf and conditionally commented

Re: [PATCHES] IPV4 addresses on IPV6 machines in pg_hba.conf

2003-09-05 Thread andrew
Bruce Momjian said: > > Would you like me to conditionally add the IPv6 line to pg_hba.conf > from initdb now? > As a matter of taste and possibly due to some paranoia I would prefer to see it added unconditionally to pg_hba.conf and conditionally commented out in initdb. (The paranoia is what say

Re: [PATCHES] IPV4 addresses on IPV6 machines in pg_hba.conf

2003-09-05 Thread Bruce Momjian
Tom Lane wrote: > Andreas Pflug <[EMAIL PROTECTED]> writes: > > are you sure it's not just for beauty's sake? > > What I didn't like about your last patch was the close coupling of the > CIDR/netmask processing to the v4-to-v6 conversion; as Andrew pointed > out, you were hacking into hba.c functi

Re: [PATCHES] IPV4 addresses on IPV6 machines in pg_hba.conf

2003-09-05 Thread andrew
Tom Lane said: > Andreas Pflug <[EMAIL PROTECTED]> writes: >> are you sure it's not just for beauty's sake? > > What I didn't like about your last patch was the close coupling of the CIDR/netmask processing to the v4-to-v6 conversion; as Andrew pointed out, you were hacking into hba.c functionalit

Re: [PATCHES] IPV4 addresses on IPV6 machines in pg_hba.conf

2003-09-05 Thread Tom Lane
Andreas Pflug <[EMAIL PROTECTED]> writes: > are you sure it's not just for beauty's sake? What I didn't like about your last patch was the close coupling of the CIDR/netmask processing to the v4-to-v6 conversion; as Andrew pointed out, you were hacking into hba.c functionality that overlapped with

Re: [PATCHES] IPV4 addresses on IPV6 machines in pg_hba.conf

2003-09-05 Thread Andreas Pflug
Tom Lane wrote: 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 lin

Re: [PATCHES] IPV4 addresses on IPV6 machines in pg_hba.conf

2003-09-05 Thread Tom Lane
Andreas Pflug <[EMAIL PROTECTED]> 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; pl

Re: [PATCHES] IPV4 addresses on IPV6 machines in pg_hba.conf

2003-09-05 Thread Andreas Pflug
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

Re: [PATCHES] IPV4 addresses on IPV6 machines in pg_hba.conf

2003-09-05 Thread Tom Lane
Andreas Pflug <[EMAIL PROTECTED]> writes: > Andrew Dunstan wrote: >> You should check that the CIDR mask is a valid integer. You would need >> to use strtol() rather than atoi() to do that. Perhaps this should be >> hoisted out of ip.c:SockAddr_cidr_mask() and put in hba.c. > Right, I added thi

Re: [PATCHES] IPV4 addresses on IPV6 machines in pg_hba.conf

2003-09-05 Thread Andreas Pflug
Andrew Dunstan wrote: Andreas, You should check that the CIDR mask is a valid integer. You would need to use strtol() rather than atoi() to do that. Perhaps this should be hoisted out of ip.c:SockAddr_cidr_mask() and put in hba.c. Right, I added this. Regards, Andreas Index: hba.c ===

Re: [PATCHES] IPV4 addresses on IPV6 machines in pg_hba.conf

2003-09-04 Thread Andrew Dunstan
Andreas, You should check that the CIDR mask is a valid integer. You would need to use strtol() rather than atoi() to do that. Perhaps this should be hoisted out of ip.c:SockAddr_cidr_mask() and put in hba.c. Sorry, I should have checked this carefully earlier. andrew Andreas Pflug wrote: Ku

Re: [PATCHES] IPV4 addresses on IPV6 machines in pg_hba.conf

2003-09-04 Thread Andreas Pflug
Kurt Roeckx wrote: You're assuming all systems have an AF_INET6 constant, which is not the case. Please make use of HAVE_IPV6. Can't directly see anything else wrong with it. Here's the patch with HAVE_IPV6 conditional compiling. Regards, Andreas Index: hba.c ===

Re: [PATCHES] IPV4 addresses on IPV6 machines in pg_hba.conf

2003-09-04 Thread Kurt Roeckx
On Wed, Sep 03, 2003 at 07:19:16PM +0200, Andreas Pflug wrote: > This was discussed in [HACKERS] TCP/IP with 7.4 beta2 broken? > > > I created a patch to hba.c which uses IPV4 entries as IPV6 entries if > running on a IPV6 system (which is detected from a port coming in as > AF_INET6). > You'r

[PATCHES] IPV4 addresses on IPV6 machines in pg_hba.conf

2003-09-03 Thread Andreas Pflug
This was discussed in [HACKERS] TCP/IP with 7.4 beta2 broken? I created a patch to hba.c which uses IPV4 entries as IPV6 entries if running on a IPV6 system (which is detected from a port coming in as AF_INET6). 192.168.0.0/24 -> :::102.168.0/120 192.168.0.0 255.255.255.0 ->