Skip interfaces without IP addresses
[bpdyndnsd] / src / ip_addr_helper.cpp
index 5d49a21..56100bb 100644 (file)
@@ -218,6 +218,10 @@ string IPAddrHelper::get_local_wan_nic_ip() const
     // Iterate through the linked list.
     for ( ifa = if_addr_struct; ifa != NULL; ifa = ifa->ifa_next)
     {
+        // Skip interfaces without IP addresses
+        if (!ifa->ifa_addr)
+            continue;
+
         // Get the address family of the actual address.
         address_family = ifa->ifa_addr->sa_family;