ifa_addr can be NULL.
authorEmil Mikulic <emikulic@gmail.com>
Sun, 17 Jul 2011 05:01:35 +0000 (15:01 +1000)
committerEmil Mikulic <emikulic@gmail.com>
Sun, 11 Sep 2011 10:50:09 +0000 (20:50 +1000)
localip.c

index c698bcf..7484629 100644 (file)
--- a/localip.c
+++ b/localip.c
@@ -65,6 +65,9 @@ localip_update(void)
          if (strncmp(ifa->ifa_name, iface, IFNAMSIZ))
             continue;   /* Wrong interface. */
 
+         if (!ifa->ifa_addr)
+            continue;   /* This can be NULL, e.g. for ppp0. */
+
          /* The first IPv4 name is always functional. */
          if ((ifa->ifa_addr->sa_family == AF_INET) && !got_v4)
          {