diff options
| author | Hajimu UMEMOTO <ume@FreeBSD.org> | 2002-10-26 19:00:14 +0000 |
|---|---|---|
| committer | Hajimu UMEMOTO <ume@FreeBSD.org> | 2002-10-26 19:00:14 +0000 |
| commit | ddb2984b5d1ed52a7513587ddb3d7d55f9f7fa28 (patch) | |
| tree | e627d1a4657f2979ac70e78eb0847420bf7475ce /lib/libc | |
| parent | 5b8ee62bc2abf5835016c2641e56cf61bbad8a2a (diff) | |
Notes
Diffstat (limited to 'lib/libc')
| -rw-r--r-- | lib/libc/net/gethostbydns.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/libc/net/gethostbydns.c b/lib/libc/net/gethostbydns.c index d55ea8939946..02cd223b2439 100644 --- a/lib/libc/net/gethostbydns.c +++ b/lib/libc/net/gethostbydns.c @@ -674,7 +674,7 @@ _dns_gethostbyaddr(void *rval, void *cb_data, va_list ap) uaddr[n] & 0xf, (uaddr[n] >> 4) & 0xf)); } - strcpy(qp, "ip6.int"); + strlcat(qbuf, "ip6.arpa", sizeof(qbuf)); break; default: abort(); @@ -684,6 +684,12 @@ _dns_gethostbyaddr(void *rval, void *cb_data, va_list ap) return NS_NOTFOUND; } n = res_query(qbuf, C_IN, T_PTR, (u_char *)buf->buf, sizeof buf->buf); + if (n < 0 && af == AF_INET6) { + *qp = '\0'; + strlcat(qbuf, "ip6.int", sizeof(qbuf)); + n = res_query(qbuf, C_IN, T_PTR, (u_char *)buf->buf, + sizeof buf->buf); + } if (n < 0) { free(buf); dprintf("res_query failed (%d)\n", n); |
