p->ifa_addr might be a NULL pointer and thus crash the program
The ifa_addr field points to a structure containing the interface
address. (The sa_family subfield should be consulted to determine
the format of the address structure.) _This field may contain a null
make sure p->ifa_addr is not NULL before using it
This is needed for Haiku which you guys probably don't care much about, but, is a potential problem on all platforms and doesn't cost much.
I'll merge this since it is obviously correct. However, I'm wondering what ifa_name contains for the interface for which ifa_addr is NULL on your system and the purpose of that interface. Which is to say I'm wondering if there are related incorrect assumptions in the fish code that this particular issue might expose if we better understood the nature of the failure.
There are 2 cases where ifa_addr can be NULL on Haiku, one is if an interface's address.sa_family == AF_UNSPEC and the other is if there was an error copying the interface's address (i.e. new throws an exception). The latter is probably not happening so I'm guessing the case we're running into is the former, one or more of the interfaces has an unspecified address family. I'm not sure whether or not there is a bug on our side here, but it is possible.
Merged as a872d9c.