fix segfault on raspberry pi
@@ -114,7 +114,8 @@ get_interface_index(int sock)
for (interface = ifs; interface != NULL; interface = interface->ifa_next) {
if (!(interface->ifa_flags & IFF_UP) || interface->ifa_flags & IFF_LOOPBACK)
continue;
- if (addr.ss_family == interface->ifa_addr->sa_family) {
+ if (interface->ifa_addr &&
+ addr.ss_family == interface->ifa_addr->sa_family) {
if (addr.ss_family == AF_INET6) {
struct sockaddr_in6 *a = (struct sockaddr_in6 *)interface->ifa_addr;
struct sockaddr_in6 *b = (struct sockaddr_in6 *)&addr;
