From aadd7b49515c1bcfaac83a700ece947d3fe13f12 Mon Sep 17 00:00:00 2001 From: paul Date: Tue, 17 Jan 2006 17:59:11 +0000 Subject: [zebra] Defensive if_getaddrs bug fix. 2006-01-17 Gunnar Stigen * if_ioctl.c: (if_getaddrs) Be defensive about assuming that struct ifaddrs will have ifa_addr filled in. --- zebra/if_ioctl.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'zebra/if_ioctl.c') 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) { -- cgit v1.2.3