Skip interfaces without IP addresses
authorThomas Jarosch <thomas.jarosch@intra2net.com>
Wed, 6 Oct 2010 12:01:01 +0000 (14:01 +0200)
committerThomas Jarosch <thomas.jarosch@intra2net.com>
Wed, 6 Oct 2010 12:01:01 +0000 (14:01 +0200)
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;