summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2011-04-13 22:20:31 +0300
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2011-04-13 22:20:31 +0300
commit66bd917b591371811fe08c5071757b2ab654a6ff (patch)
tree8dc443d2a3d0316a4957d948cac3afb640438524 /src
parent083cc494228c55f38d2fcc9ec19c957eff7adb00 (diff)
On HP/UX, the structs used by ioctl(SIOCGLIFCONF) are named differently
than on other platforms, and only IPv6 addresses are returned. Because of those two issues, fall back to ioctl(SIOCGIFCONF) on HP/UX, so that it at least compiles and finds IPv4 addresses. This function is currently only used for interpreting samehost/samenet in pg_hba.conf, which isn't that critical.
Diffstat (limited to 'src')
-rw-r--r--src/backend/libpq/ip.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/backend/libpq/ip.c b/src/backend/libpq/ip.c
index 7c17210cbe6..c6c264e4b0c 100644
--- a/src/backend/libpq/ip.c
+++ b/src/backend/libpq/ip.c
@@ -638,9 +638,15 @@ pg_foreach_ifaddr(PgIfAddrCallback callback, void *cb_data)
/*
* SIOCGIFCONF does not return IPv6 addresses on Solaris
* and HP/UX. So we prefer SIOCGLIFCONF if it's available.
+ *
+ * On HP/UX, however, it *only* returns IPv6 addresses,
+ * and the structs are named slightly differently too.
+ * We'd have to do another call with SIOCGIFCONF to get the
+ * IPv4 addresses as well. We don't currently bother, just
+ * fall back to SIOCGIFCONF on HP/UX.
*/
-#if defined(SIOCGLIFCONF)
+#if defined(SIOCGLIFCONF) && !defined(__hpux)
/*
* Enumerate the system's network interface addresses and call the callback