aboutsummaryrefslogtreecommitdiffstats
path: root/host
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2011-01-26 12:38:17 -0800
committerJosh Blum <josh@joshknows.com>2011-01-26 12:38:17 -0800
commit94f5b0471bb49952ab6de87ebf90707ebb4b5810 (patch)
tree83fc2799aaabee47a220a53b6d0dc267e09a819f /host
parent8c9e90c71bbe034b09c16dbe049e7414c415823f (diff)
downloaduhd-94f5b0471bb49952ab6de87ebf90707ebb4b5810.tar.gz
uhd-94f5b0471bb49952ab6de87ebf90707ebb4b5810.tar.bz2
uhd-94f5b0471bb49952ab6de87ebf90707ebb4b5810.zip
uhd: if_addrs check that iter->ifa_addr is NULL before continuing
Happened when building UHD within the OpenWRT environment where ifa_addr can be null it seems!
Diffstat (limited to 'host')
-rw-r--r--host/lib/transport/if_addrs.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/host/lib/transport/if_addrs.cpp b/host/lib/transport/if_addrs.cpp
index ad9a2325b..17cf8455b 100644
--- a/host/lib/transport/if_addrs.cpp
+++ b/host/lib/transport/if_addrs.cpp
@@ -42,6 +42,7 @@ std::vector<uhd::transport::if_addrs_t> uhd::transport::get_if_addrs(void){
if (getifaddrs(&ifap) == 0){
for (struct ifaddrs *iter = ifap; iter != NULL; iter = iter->ifa_next){
//ensure that the entries are valid
+ if (iter->ifa_addr == NULL) continue;
if (iter->ifa_addr->sa_family != AF_INET) continue;
if (iter->ifa_netmask->sa_family != AF_INET) continue;
if (iter->ifa_broadaddr->sa_family != AF_INET) continue;