]> granicus.if.org Git - postgresql/commitdiff
On HP/UX, the structs used by ioctl(SIOCGLIFCONF) are named differently
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Wed, 13 Apr 2011 19:20:31 +0000 (22:20 +0300)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Wed, 13 Apr 2011 19:25:27 +0000 (22:25 +0300)
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.

src/backend/libpq/ip.c

index 1897b959c8173b76438058d4878b7d6b8edd40b6..cc6c2abac683780082b6e7b2d8345f45c05df16d 100644 (file)
@@ -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