summaryrefslogtreecommitdiff
path: root/zebra/if_ioctl.c
diff options
context:
space:
mode:
authorpaul <paul>2006-01-17 17:59:11 +0000
committerpaul <paul>2006-01-17 17:59:11 +0000
commit61f42aed5e1cee1a853f92110d794a286995d203 (patch)
treee9eededc78bd39443ebf03565ad113c16f3ab49d /zebra/if_ioctl.c
parentc713300ab429c8779be98ec3c8dc888821405d55 (diff)
[zebra] Defensive if_getaddrs bug fix.
2006-01-17 Gunnar Stigen <gunnar.stigen@axxessit.no> * if_ioctl.c: (if_getaddrs) Be defensive about assuming that struct ifaddrs will have ifa_addr filled in.
Diffstat (limited to 'zebra/if_ioctl.c')
-rw-r--r--zebra/if_ioctl.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/zebra/if_ioctl.c b/zebra/if_ioctl.c
index b00a29cd..788184f8 100644
--- a/zebra/if_ioctl.c
+++ b/zebra/if_ioctl.c
@@ -228,6 +228,13 @@ if_getaddrs (void)
for (ifapfree = ifap; ifap; ifap = ifap->ifa_next)
{
+ if (ifap->ifa_addr == NULL)
+ {
+ zlog_err ("%s: nonsensical ifaddr with NULL ifa_addr, ifname %s",
+ __func__, (ifap->ifa_name ? ifap->ifa_name : "(null)"));
+ continue;
+ }
+
ifp = if_lookup_by_name (ifap->ifa_name);
if (ifp == NULL)
{