diff options
| -rw-r--r-- | src/include/ChangeLog | 2 | ||||
| -rw-r--r-- | src/include/fake-addrinfo.h | 12 |
2 files changed, 14 insertions, 0 deletions
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 <raeburn@mit.edu> 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), |
