Skip to content

Commit 40e6401

Browse files
committed
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.
1 parent 54685b1 commit 40e6401

File tree

1 file changed

+7
-1
lines changed
  • src/backend/libpq

1 file changed

+7
-1
lines changed

src/backend/libpq/ip.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -638,9 +638,15 @@ pg_foreach_ifaddr(PgIfAddrCallback callback, void *cb_data)
638638
/*
639639
* SIOCGIFCONF does not return IPv6 addresses on Solaris
640640
* and HP/UX. So we prefer SIOCGLIFCONF if it's available.
641+
*
642+
* On HP/UX, however, it *only* returns IPv6 addresses,
643+
* and the structs are named slightly differently too.
644+
* We'd have to do another call with SIOCGIFCONF to get the
645+
* IPv4 addresses as well. We don't currently bother, just
646+
* fall back to SIOCGIFCONF on HP/UX.
641647
*/
642648

643-
#if defined(SIOCGLIFCONF)
649+
#if defined(SIOCGLIFCONF) && !defined(__hpux)
644650

645651
/*
646652
* Enumerate the system's network interface addresses and call the callback

0 commit comments

Comments
 (0)