From owner-freebsd-questions@FreeBSD.ORG Tue Apr 1 20:12:35 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0B42A37B401 for ; Tue, 1 Apr 2003 20:12:35 -0800 (PST) Received: from segfault.monkeys.com (segfault.monkeys.com [66.60.157.246]) by mx1.FreeBSD.org (Postfix) with ESMTP id 942B543FA3 for ; Tue, 1 Apr 2003 20:12:34 -0800 (PST) (envelope-from rfg@monkeys.com) Received: from monkeys.com (unknown [127.0.0.1]) by segfault.monkeys.com (Postfix) with ESMTP id 3BB0F41F98 for ; Tue, 1 Apr 2003 20:12:34 -0800 (PST) To: freebsd-questions@freebsd.org Date: Tue, 01 Apr 2003 20:12:34 -0800 Message-ID: <26986.1049256754@monkeys.com> From: "Ronald F. Guilmette" Subject: Is this a libc bug ? (gethostbyaddr) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Apr 2003 04:12:35 -0000 Why does the program below produce radically different results when linked either (a) with just the libc on FreeBSD 4.7 or else (b) with the BIND library (libbind.a) from the ISC 8.x.x BIND release, and then with libc? Is FreeBSD's gethostbyaddr(3) mishandling the classless in-addr.arpa delegation in the case of 62.23.166.218 ? ====================================================================== #include #include #include #include #include #include int main (void) { auto struct in_addr addr; register struct hostent const *hp; inet_aton ("62.23.166.218", &addr); hp = gethostbyaddr ((char const *)&addr, sizeof addr, AF_INET); if (hp) printf ("%s\n", hp->h_name); else printf ("No rDNS for %s\n", inet_ntoa (addr)); return 0; }