+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,
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>