* foreachaddr.c (foreach_localaddr) [HAVE_IFADDRS_H]: Skip over any returned
authorKen Raeburn <raeburn@mit.edu>
Tue, 26 Aug 2003 16:57:32 +0000 (16:57 +0000)
committerKen Raeburn <raeburn@mit.edu>
Tue, 26 Aug 2003 16:57:32 +0000 (16:57 +0000)
data structure with a NULL ifa_addr field.

ticket: 1770
version_reported: 1.3
target_version: 1.3.2
tags: pullup

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@15790 dc483132-0cff-0310-8789-dd5450dbe970

src/include/ChangeLog
src/include/foreachaddr.c

index 0323430141c260eedb7c3d58cc0112ec3408e7bb..58830ef5e1e7a37b22161d92d4c5bfe32e55ca4c 100644 (file)
@@ -1,3 +1,8 @@
+2003-08-26  Ken Raeburn  <raeburn@mit.edu>
+
+       * foreachaddr.c (foreach_localaddr) [HAVE_IFADDRS_H]: Skip over
+       any returned data structure with a NULL ifa_addr field.
+
 2003-08-21  Ken Raeburn  <raeburn@mit.edu>
 
        * fake-addrinfo.h (getnameinfo): Define to my_fake_getnameinfo
index 101f8efca97371a248fe204d97746fada9ac0530..f91034a77b4373d05c12b12d59652f98c80af035 100644 (file)
@@ -383,6 +383,20 @@ foreach_localaddr (/*@null@*/ void *data,
        if ((ifp->ifa_flags & IFF_UP) == 0)
            continue;
        if (ifp->ifa_flags & IFF_LOOPBACK) {
+           /* Pretend it's not up, so the second pass will skip
+              it.  */
+           ifp->ifa_flags &= ~IFF_UP;
+           continue;
+       }
+       if (ifp->ifa_addr == NULL) {
+           /* Can't use an interface without an address.  Linux
+              apparently does this sometimes.  [RT ticket 1770 from
+              Maurice Massar, also Debian bug 206851, shows the
+              problem with a PPP link on a newer kernel than I'm
+              running.]
+
+              Pretend it's not up, so the second pass will skip
+              it.  */
            ifp->ifa_flags &= ~IFF_UP;
            continue;
        }