From: Thomas Jarosch Date: Wed, 6 Oct 2010 12:01:01 +0000 (+0200) Subject: Skip interfaces without IP addresses X-Git-Tag: v1.1~92 X-Git-Url: http://developer.intra2net.com/git/?a=commitdiff_plain;h=3e0bfbf5ee552b20aaf956dc7c6c51aebe9eab54;p=bpdyndnsd Skip interfaces without IP addresses --- diff --git a/src/ip_addr_helper.cpp b/src/ip_addr_helper.cpp index 5d49a21..56100bb 100644 --- a/src/ip_addr_helper.cpp +++ b/src/ip_addr_helper.cpp @@ -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;