In openvz we found out some interfaces may return a null pointer here.

Skip them if no address is provided or we later get a segfault because
we dereference a null pointer.
This commit is contained in:
Simo Sorce 2008-07-15 16:13:43 -04:00
parent 4b4e0e1516
commit 67f62709f8

View File

@ -1299,6 +1299,10 @@ int main(int argc, char *argv[])
for (tifa = ifa; tifa; tifa = tifa->ifa_next) {
if (NULL == tifa->ifa_addr)
/* uhmm no address ?? skip it */
continue;
if (tifa->ifa_addr->sa_family != AF_INET &&
tifa->ifa_addr->sa_family != AF_INET6) {
/* not interesting for us */