708fedd
Screen out interfaces which have no address in foreach_localaddr().  (Per man
708fedd
pages for OpenBSD and OS/X, they are legal.)  If it doesn't have an address,
708fedd
the functions which call this function (src/kdc/network.c, which wants to
708fedd
listen on the interfaces, and src/lib/krb5/os/localaddr.c, which just wants a
708fedd
list of local addresses), have no use for it anyway.
708fedd
708fedd
This is slightly different than the fix proposed by Paul Jakma at
708fedd
http://mailman.mit.edu/pipermail/krb5-bugs/2004-January/002152.html, but is
708fedd
more or less equivalent.
708fedd
708fedd
Don't worry, printifaddr() already checks that ifp->ifa_addr != NULL before
708fedd
printing it.
708fedd
708fedd
--- krb5-1.4/src/lib/krb5/os/localaddr.c	2005-02-18 11:20:52.000000000 -0500
708fedd
+++ krb5-1.4/src/lib/krb5/os/localaddr.c	2005-02-18 11:23:52.000000000 -0500
708fedd
@@ -435,6 +435,8 @@
708fedd
 #ifdef DEBUG
708fedd
 	printifaddr (ifp);
708fedd
 #endif
708fedd
+	if (ifp->ifa_addr == NULL)
708fedd
+	    continue;
708fedd
 	if ((ifp->ifa_flags & IFF_UP) == 0)
708fedd
 	    continue;
708fedd
 	if (ifp->ifa_flags & IFF_LOOPBACK) {
708fedd
@@ -458,6 +460,8 @@
708fedd
 	/* If this address is a duplicate, punt.  */
708fedd
 	match = 0;
708fedd
 	for (ifp2 = ifp_head; ifp2 && ifp2 != ifp; ifp2 = ifp2->ifa_next) {
708fedd
+	    if (ifp2->ifa_addr == NULL)
708fedd
+		continue;
708fedd
 	    if ((ifp2->ifa_flags & IFF_UP) == 0)
708fedd
 		continue;
708fedd
 	    if (ifp2->ifa_flags & IFF_LOOPBACK)