Make address family search via ioctl more accurate on obscure platforms
The following address family search functions only return an IPv6 address on some platforms:
- ioctl(.,SIOCGIFCONF,.) only returns IPv4 addresses, except:
- on HP-UX and Solaris, which support AF_INET6 with SIOCGLIFCONF
- on AIX, using the sa_len field in struct sockaddr to distinguish between IPv4 and IPv6 addresses
- on MVS and z/OS, which support AF_INET6 with SIOCGIFCONF6 / __net_ifconf6header_s
- see http://www-01.ibm.com/support/docview.wss?uid=isg1PK22885 for details
- on these platforms, we should try AF_INET, then AF_INET6, and then both addresses should be returned