From: Ken Raeburn Date: Tue, 26 Mar 2002 22:46:57 +0000 (+0000) Subject: * fake-addrinfo.h (fake_getnameinfo) [__GNUC__ && __mips__]: Don't call X-Git-Tag: krb5-1.3-alpha1~818 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=b4ba391410fa85ba25fa0c85322b3c108bbefd2b;p=krb5.git * fake-addrinfo.h (fake_getnameinfo) [__GNUC__ && __mips__]: Don't call inet_ntoa, struct passing doesn't work. Format the output string locally. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@14293 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/include/ChangeLog b/src/include/ChangeLog index 18770f23a..e0c72d623 100644 --- a/src/include/ChangeLog +++ b/src/include/ChangeLog @@ -4,6 +4,8 @@ defined functions static, and inline if gcc is used. Drop FAI_PREFIX renaming hacks. Fix some bugs in the separation of getnameinfo from getaddrinfo/freeaddrinfo for wrapping purposes. + (fake_getnameinfo) [__GNUC__ && __mips__]: Don't call inet_ntoa, + struct passing doesn't work. Format the output string locally. * fake-addrinfo.c: Delete. 2002-03-11 Ken Raeburn diff --git a/src/include/fake-addrinfo.h b/src/include/fake-addrinfo.h index b0660501e..0b5fbf201 100644 --- a/src/include/fake-addrinfo.h +++ b/src/include/fake-addrinfo.h @@ -435,10 +435,22 @@ fake_getnameinfo (const struct sockaddr *sa, socklen_t len, if (host) { if (flags & NI_NUMERICHOST) { +#if defined(__GNUC__) && defined(__mips__) + /* The inet_ntoa call, passing a struct, fails on Irix 6.5 + using gcc 2.95; we get back "0.0.0.0". Since this in a + configuration still important at Athena, here's the + workaround.... */ + unsigned char *uc = (unsigned char *) &sinp->sin_addr; + char tmpbuf[20]; + numeric_host: + sprintf(tmpbuf, "%d.%d.%d.%d", uc[0], uc[1], uc[2], uc[3]); + strncpy(host, tmpbuf, hostlen); +#else char *p; numeric_host: p = inet_ntoa (sinp->sin_addr); strncpy (host, p, hostlen); +#endif } else { hp = gethostbyaddr ((const char *) &sinp->sin_addr, sizeof (struct in_addr),