Re: compile error via SIOCGLIFCONF from ip.c on hpux-11

From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Andrew Chernow <achernow(at)esilo(dot)com>
Subject: Re: compile error via SIOCGLIFCONF from ip.c on hpux-11
Date: 2010-11-29 20:00:53
Message-ID: AANLkTinKCiLkp-2+X1qrv_5JeonwGQ=MS-n+S7px13Yt@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Nov 29, 2010 at 2:26 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Merlin Moncure <mmoncure(at)gmail(dot)com> writes:
>> How do you test this feature?
>
> Try src/tools/ifaddrs/test_ifaddrs.c.  I think the only usage in the
> core code is testing samehost/samenet matches in pg_hba.conf.

It looks like this is unfortunately more involved. The test of my
adjustment above immediately failed with ENOENT, which you have to
expect on hpux apparently. According to some googling (see:
http://cvsweb.netbsd.org/bsdweb.cgi/src/dist/bind/lib/isc/unix/Attic/ifiter_ioctl.c?rev=1.1.1.4.4.1&content-type=text/x-cvsweb-markup
and others), the long method returns ip6 addresses and the short
method returns ip4 addresses, and you have to do both on hpux always.

Forcing the short method, the test worked, I got the loopback and the
local address. So we have a couple of options here: hacking the
foreach to use the short method on hpux is certainly better situation
than we have now, or fixing this 'properly', means refactoring this
file a bit and adding a configure test or leaning on an hpux macro. I
have no way of testing the long form method I posed above -- does
anybody have an ipv6 hpux box?

merlin

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Dimitri Fontaine 2010-11-29 20:03:06 Re: pg_execute_from_file review
Previous Message Tom Lane 2010-11-29 19:26:12 Re: compile error via SIOCGLIFCONF from ip.c on hpux-11