From owner-freebsd-bugs Thu Aug 15 10:40:11 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9A08437B400 for ; Thu, 15 Aug 2002 10:40:03 -0700 (PDT) Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id D505243E65 for ; Thu, 15 Aug 2002 10:40:02 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.4/8.12.4) with ESMTP id g7FHe2JU072807 for ; Thu, 15 Aug 2002 10:40:02 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.4/8.12.4/Submit) id g7FHe2jF072806; Thu, 15 Aug 2002 10:40:02 -0700 (PDT) Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 18A1F37B400 for ; Thu, 15 Aug 2002 10:34:31 -0700 (PDT) Received: from mailout11.sul.t-online.com (mailout11.sul.t-online.com [194.25.134.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id DF5AD43E72 for ; Thu, 15 Aug 2002 10:34:29 -0700 (PDT) (envelope-from logix@foobar.franken.de) Received: from fwd03.sul.t-online.de by mailout11.sul.t-online.com with smtp id 17fOVw-0003MT-0B; Thu, 15 Aug 2002 19:34:28 +0200 Received: from foobar.franken.de (520066542279-0001@[217.229.166.39]) by fmrl03.sul.t-online.com with esmtp id 17fOXD-06j9BwC; Thu, 15 Aug 2002 19:35:47 +0200 Received: from foobar.franken.de (localhost [127.0.0.1]) by foobar.franken.de (8.12.5/8.12.5) with ESMTP id g7FHYMNr066448 for ; Thu, 15 Aug 2002 19:34:23 +0200 (CEST) (envelope-from logix@foobar.franken.de) Received: (from logix@localhost) by foobar.franken.de (8.12.5/8.12.5/Submit) id g7FHYLRn066447; Thu, 15 Aug 2002 19:34:21 +0200 (CEST) Message-Id: <200208151734.g7FHYLRn066447@foobar.franken.de> Date: Thu, 15 Aug 2002 19:34:21 +0200 (CEST) From: Harold Gutch Reply-To: Harold Gutch To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: bin/41689: libc lacks RFC 3152 compliance (patch included) Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >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