Thread: Re: [COMMITTERS] pgsql: Define INADDR_NONE on Solaris when it's missing.
2010/1/28 Magnus Hagander <magnus@hagander.net>: > On Thu, Jan 28, 2010 at 21:16, Tom Lane <tgl@sss.pgh.pa.us> wrote: >> Magnus Hagander <magnus@hagander.net> writes: >>> On Thu, Jan 28, 2010 at 17:16, Tom Lane <tgl@sss.pgh.pa.us> wrote: >>>> 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. >> >>> "Path of least resistance?" >> >>> Which method would you suggest? >> >> I haven't actually read the RADIUS patch, but generally we rely on >> pg_getaddrinfo_all to interpret strings representing IP addresses. >> Is there a reason not to use that? > > I don't think so. I'll look it over. Here's what I came up with. Works well on the platforms I've tried, but I haven't tried on a non-ipv6 capable one yet (need to find one..) I'll also remove the defines from solaris.h when applying it. -- Magnus Hagander Me: http://www.hagander.net/ Work: http://www.redpill-linpro.com/
Attachment
Magnus Hagander <magnus@hagander.net> writes: > Here's what I came up with. Works well on the platforms I've tried, > but I haven't tried on a non-ipv6 capable one yet (need to find one..) Hmm, well, I have an ipv6-ignorant HPUX box at hand. I do not have a radius server though. Are you only concerned about whether it compiles, or do you want actual testing? regards, tom lane
2010/2/1 Magnus Hagander <magnus@hagander.net>: > 2010/1/28 Magnus Hagander <magnus@hagander.net>: >> On Thu, Jan 28, 2010 at 21:16, Tom Lane <tgl@sss.pgh.pa.us> wrote: >>> Magnus Hagander <magnus@hagander.net> writes: >>>> On Thu, Jan 28, 2010 at 17:16, Tom Lane <tgl@sss.pgh.pa.us> wrote: >>>>> 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. >>> >>>> "Path of least resistance?" >>> >>>> Which method would you suggest? >>> >>> I haven't actually read the RADIUS patch, but generally we rely on >>> pg_getaddrinfo_all to interpret strings representing IP addresses. >>> Is there a reason not to use that? >> >> I don't think so. I'll look it over. > > Here's what I came up with. Works well on the platforms I've tried, > but I haven't tried on a non-ipv6 capable one yet (need to find one..) > I'll also remove the defines from solaris.h when applying it. Applied with some adjustments needed for non-ipv6 platforms. -- Magnus HaganderMe: http://www.hagander.net/Work: http://www.redpill-linpro.com/