Use portable and type-safe way to obtain network interface addresses where available
Use of SIOCGIFCONF is quite error prone. It fills fixed sized
elements array on Linux filled only by IPv4 (AF_INET).
On the other hand on BSD it returns all addresses including
hardware ones and IPv6. It requires variable size for
entries where address does not fit into struct sockaddr.
But switching rules seems to differ even between BSD flavors.
On the other hand getifaddrs() and struct ifaddrs
are defined with potability and extendability in mind.