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:
1 parent
4b4e0e1516
commit
67f62709f8
1 file changed
+4
@@ -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 */
|
||||
|
||||
Reference in new issue
Block a user