From: Tom Yu Date: Mon, 24 Jan 2000 21:53:43 +0000 (+0000) Subject: * get_myaddress.c (gssrpc_get_myaddress): Copy in from NetBSD; X-Git-Tag: krb5-1.2-beta1~151 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=8662948f9e27553df98dbcfbec373ae9f89f5205;p=krb5.git * get_myaddress.c (gssrpc_get_myaddress): Copy in from NetBSD; use loopback address only. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@11966 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/rpc/ChangeLog b/src/lib/rpc/ChangeLog index 1d8174d62..77b0f06a0 100644 --- a/src/lib/rpc/ChangeLog +++ b/src/lib/rpc/ChangeLog @@ -1,3 +1,8 @@ +2000-01-24 Tom Yu + + * get_myaddress.c (gssrpc_get_myaddress): Copy in from NetBSD; + use loopback address only. + 1999-10-26 Tom Yu * Makefile.in: Clean up usage of CFLAGS, CPPFLAGS, DEFS, DEFINES, diff --git a/src/lib/rpc/get_myaddress.c b/src/lib/rpc/get_myaddress.c index f86f86dad..4c9bf29ac 100644 --- a/src/lib/rpc/get_myaddress.c +++ b/src/lib/rpc/get_myaddress.c @@ -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 #include