From 94f5b0471bb49952ab6de87ebf90707ebb4b5810 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Wed, 26 Jan 2011 12:38:17 -0800 Subject: 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! --- host/lib/transport/if_addrs.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'host/lib/transport/if_addrs.cpp') 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::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; -- cgit v1.2.3