Date: Thu, 15 Aug 2002 19:34:21 +0200 (CEST) From: Harold Gutch <logix@foobar.franken.de> To: FreeBSD-gnats-submit@FreeBSD.org Subject: bin/41689: libc lacks RFC 3152 compliance (patch included) Message-ID: <200208151734.g7FHYLRn066447@foobar.franken.de>
next in thread | raw e-mail | index | archive | help
>Number: 41689 >Category: bin >Synopsis: libc lacks RFC 3152 compliance (patch included) >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Aug 15 10:40:01 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Harold Gutch >Release: FreeBSD 4.6-STABLE i386 >Organization: >Environment: System: FreeBSD foobar.franken.de 4.6-STABLE FreeBSD 4.6-STABLE #3: Wed Aug 7 01:01:01 CEST 2002 logix@foobar.franken.de:/usr/obj/usr/src/sys/FOOBAR i386 >Description: The FreeBSD libc does reverse resolving in the IPv6 address space using the IP6.INT domain (RFC 1886). RFC 3152 supersedes this and recommends using the IP6.ARPA domain. >How-To-Repeat: >Fix: The following patch makes libc reverse resolve IPv6 addresses in the IP6.ARPA domain. If this fails, it falls back to the old behaviour and tries to resolve the IPv6 address in the IP6.INT domain. Apply, recompile etc. --- src/lib/libc/net/gethostbydns.c.orig Wed Jul 3 10:52:42 2002 +++ src/lib/libc/net/gethostbydns.c Thu Aug 15 19:02:08 2002 @@ -666,12 +666,17 @@ uaddr[n] & 0xf, (uaddr[n] >> 4) & 0xf)); } - strcpy(qp, "ip6.int"); + strcpy(qp, "ip6.arpa"); break; default: abort(); } n = res_query(qbuf, C_IN, T_PTR, (u_char *)buf.buf, sizeof buf.buf); + if (n < 0 && af == AF_INET6) { + strcpy(qp, "ip6.int"); + n = res_query(qbuf, C_IN, T_PTR, (u_char *)buf.buf, + sizeof buf.buf); + } if (n < 0) { dprintf("res_query failed (%d)\n", n); return NS_UNAVAIL; --- src/lib/libc/net/name6.c.orig Wed Jul 3 10:52:43 2002 +++ src/lib/libc/net/name6.c Thu Aug 15 19:00:34 2002 @@ -1549,7 +1549,7 @@ *bp++ = hex[c >> 4]; *bp++ = '.'; } - strcpy(bp, "ip6.int"); + strcpy(bp, "ip6.arpa"); break; #endif default: @@ -1567,6 +1567,12 @@ } n = res_query(qbuf, C_IN, T_PTR, buf.buf, sizeof buf.buf); +#ifdef INET6 + if (n < 0 && af == AF_INET6) { + strcpy(bp, "ip6.int"); + n = res_query(qbuf, C_IN, T_PTR, buf.buf, sizeof buf.buf); + } +#endif if (n < 0) { *errp = h_errno; return NS_UNAVAIL; >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200208151734.g7FHYLRn066447>