Mercurial > hg > dhcpcd
changeset 1315:6e58b411b02c draft
Some glibc versions have a NULL ifa_addr for the ifa from getifaddrs(3).
| author | Roy Marples <roy@marples.name> |
|---|---|
| date | Sun, 10 May 2009 20:20:18 +0000 |
| parents | 77ad973b3bc0 |
| children | a21d1cd02a90 |
| files | net.c |
| diffstat | 1 files changed, 4 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/net.c Sun May 10 16:21:57 2009 +0000 +++ b/net.c Sun May 10 20:20:18 2009 +0000 @@ -272,6 +272,8 @@ ifs = ifl = NULL; for (ifa = ifaddrs; ifa; ifa = ifa->ifa_next) { + if (ifa->ifa_addr == NULL) /* should not happen */ + continue; #ifdef AF_LINK if (ifa->ifa_addr->sa_family != AF_LINK) continue; @@ -372,6 +374,8 @@ retval = 0; for (ifa = ifaddrs; ifa; ifa = ifa->ifa_next) { + if (ifa->ifa_addr == NULL) /* should not happen */ + continue; if (ifa->ifa_addr->sa_family != AF_INET || strcmp(ifa->ifa_name, ifname) != 0) continue;
