]> rtime.felk.cvut.cz Git - orte/eurobot.git/commitdiff
Skip interfaces returned by getifaddrs() which has no address assigned.
authorPavel Pisa <pisa@cmp.felk.cvut.cz>
Sat, 14 Sep 2013 18:02:32 +0000 (20:02 +0200)
committerPavel Pisa <pisa@cmp.felk.cvut.cz>
Sat, 14 Sep 2013 18:02:32 +0000 (20:02 +0200)
Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
orte/liborte/sock.c

index 431080426538d8a9bc27795c16a36fb0ff906738..12b9c5987599084aec8ca6ef100340cbade37db7 100644 (file)
@@ -182,6 +182,10 @@ sock_get_local_interfaces(sock_t *sock,ORTEIFProp *IFProp,char *IFCount) {
   }
 
   for (ifa_it = ifa; ifa_it != NULL; ifa_it = ifa_it->ifa_next) {
+    if (ifa_it->ifa_addr == NULL) {
+      SOCK_INTF_DEBUG("interace %s without address ... skipping\n", ifa_it->ifa_name);
+      continue;
+    }
     SOCK_INTF_DEBUG("interace %s SA_%d addr 0x%08lx flags 0x%08lx %s %s ... ",
            ifa_it->ifa_name,
            ifa_it->ifa_addr->sa_family,