* localaddr.c (krb5_os_localaddr): Don't look for -1 return value from
authorKen Raeburn <raeburn@mit.edu>
Mon, 5 Mar 2001 20:57:39 +0000 (20:57 +0000)
committerKen Raeburn <raeburn@mit.edu>
Mon, 5 Mar 2001 20:57:39 +0000 (20:57 +0000)
foreach_localaddr.
(print_addr): Only process AF_INET6 addresses if AF_INET6 is defined.

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

src/lib/krb5/os/ChangeLog
src/lib/krb5/os/localaddr.c

index 92e14c5647fb4af7537e33a729dc283005f059e4..c086048a70797a0c41ede00a92be15e8394762a8 100644 (file)
@@ -1,5 +1,10 @@
 2001-03-05  Ken Raeburn  <raeburn@mit.edu>
 
+       * localaddr.c (krb5_os_localaddr): Don't look for -1 return value
+       from foreach_localaddr.
+       (print_addr): Only process AF_INET6 addresses if AF_INET6 is
+       defined.
+
        * gmt_mktime.c (gmt_mktime): Handle years earlier than 1970.
        (main) [TEST_LEAP]: New routine, driver for testing.
        * Makefile.in (t_mktime): New target.
index bcb861eb6e8e9fdb835bbd255aff377ef0c2583a..82c5863f98ca89ceabba1689b210858666bfbf1c 100644 (file)
@@ -499,12 +499,14 @@ static int print_addr (/*@unused@*/ void *dataptr, struct sockaddr *sa)
        printf ("addr %s\n",
                inet_ntoa (((struct sockaddr_in *)sa)->sin_addr));
        break;
+#ifdef AF_INET6
     case AF_INET6:
        printf ("addr %s\n",
                inet_ntop (sa->sa_family,
                           &((struct sockaddr_in6 *)sa)->sin6_addr,
                           buf, sizeof (buf)));
        break;
+#endif
 #ifdef AF_LINK
     case AF_LINK:
        printf ("linkaddr\n");
@@ -679,7 +681,7 @@ krb5_os_localaddr(context, addr)
                krb5_xfree (data.addr_temp[i]);
            free (data.addr_temp);
        }
-       if (r == -1 && data.mem_err)
+       if (data.mem_err)
            return ENOMEM;
        else
            return r;