* get_myaddress.c (gssrpc_get_myaddress): Copy in from NetBSD;
authorTom Yu <tlyu@mit.edu>
Mon, 24 Jan 2000 21:53:43 +0000 (21:53 +0000)
committerTom Yu <tlyu@mit.edu>
Mon, 24 Jan 2000 21:53:43 +0000 (21:53 +0000)
use loopback address only.

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

src/lib/rpc/ChangeLog
src/lib/rpc/get_myaddress.c

index 1d8174d62cc68b8f99d1547d72c1adc67f8e3744..77b0f06a0410fcd004df63e812066746cc23f8c1 100644 (file)
@@ -1,3 +1,8 @@
+2000-01-24  Tom Yu  <tlyu@mit.edu>
+
+       * get_myaddress.c (gssrpc_get_myaddress): Copy in from NetBSD;
+       use loopback address only.
+
 1999-10-26  Tom Yu  <tlyu@mit.edu>
 
        * Makefile.in: Clean up usage of CFLAGS, CPPFLAGS, DEFS, DEFINES,
index f86f86dad29ec7e5311fe42eae538ca657ada504..4c9bf29ac0ccaaf23ad04b38aea8e4d6836828a8 100644 (file)
@@ -51,33 +51,12 @@ static char sccsid[] = "@(#)get_myaddress.c 1.4 87/08/11 Copyr 1984 Sun Micro";
 gssrpc_get_myaddress(addr)
        struct sockaddr_in *addr;
 {
-     krb5_address **addrs, **a;
-     int ret;
-
-     /* Hack!  krb5_os_localaddr does not use the context arg! */
-     if (ret = krb5_os_localaddr(NULL, &addrs)) {
-         com_err("get_myaddress", ret, "calling krb5_os_localaddr");
-         exit(1);
-     }
-     a = addrs;
-     while (*a) {
-         if ((*a)->addrtype == ADDRTYPE_INET) {
-              memset(addr, 0, sizeof(*addr));
-              addr->sin_family = AF_INET;
-              addr->sin_port = htons(PMAPPORT);
-              memcpy(&addr->sin_addr, (*a)->contents, sizeof(addr->sin_addr));
-              break;
-         }
-         a++;
-     }
-     if (*a == NULL) {
-         com_err("get_myaddress", 0, "no local AF_INET address");
-         exit(1);
-     }
-     /* Hack!  krb5_free_addresses does not use the context arg! */
-     krb5_free_addresses(NULL, addrs);
+       memset((void *) addr, 0, sizeof(*addr));
+       addr->sin_family = AF_INET;
+       addr->sin_port = htons(PMAPPORT);
+       addr->sin_addr.s_addr = htonl(INADDR_LOOPBACK);
+       return (0);
 }
-
 #else /* !GSSAPI_KRB5 */
 #include <gssrpc/types.h>
 #include <gssrpc/pmap_prot.h>