summaryrefslogtreecommitdiffstats
path: root/src/include/foreachaddr.c
diff options
context:
space:
mode:
authorKen Raeburn <raeburn@mit.edu>2003-08-26 16:57:32 +0000
committerKen Raeburn <raeburn@mit.edu>2003-08-26 16:57:32 +0000
commitb8972b4c97dbc1c7960158b9e05c83a35efcb0e8 (patch)
tree7e71b17d56d97418076ffebd3956e8523f250b9c /src/include/foreachaddr.c
parent2ba8f4cd98d51fea4ff33cb2ab5f77cd7321dd2a (diff)
downloadkrb5-b8972b4c97dbc1c7960158b9e05c83a35efcb0e8.tar.gz
krb5-b8972b4c97dbc1c7960158b9e05c83a35efcb0e8.tar.xz
krb5-b8972b4c97dbc1c7960158b9e05c83a35efcb0e8.zip
* foreachaddr.c (foreach_localaddr) [HAVE_IFADDRS_H]: Skip over any returned
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
Diffstat (limited to 'src/include/foreachaddr.c')
-rw-r--r--src/include/foreachaddr.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/include/foreachaddr.c b/src/include/foreachaddr.c
index 101f8efca9..f91034a77b 100644
--- a/src/include/foreachaddr.c
+++ b/src/include/foreachaddr.c
@@ -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;
}