patch: crash during getIfAddrs

From: Adrian Chadd (adrian@creative.net.au)
Date: Mon Sep 26 2005 - 02:38:51 MDT


Hiya,

I've noticed that an interface on my linux-2.6 desktop (teql0)
would have no inet family information. This would cause polyclt/srv
to crash during initialisation.

This patch fixes it by skipping over interfaces which don't
have an address family.

--- getIfAddrs.cc.orig 2005-09-26 16:16:24.000000000 +0800
+++ getIfAddrs.cc 2005-09-26 16:21:46.000000000 +0800
@@ -103,6 +103,8 @@
                return false;
        }
        for (ifp = ifap; ifp; ifp = ifp->ifa_next) {
+ if (ifp->ifa_addr == NULL)
+ continue;
                if (ifname && !ifNameMatch(ifname, ifp->ifa_name))
                        continue;
                if (AF_INET == ifp->ifa_addr->sa_family

Adrian



This archive was generated by hypermail 2b29 : Mon Feb 06 2006 - 12:00:29 MST