From owner-freebsd-sparc Fri Jan 3 6:50: 6 2003 Delivered-To: freebsd-sparc@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1AA5F37B401 for ; Fri, 3 Jan 2003 06:50:04 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9CD2C43EE5 for ; Fri, 3 Jan 2003 06:50:02 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id h03Eo2NS064132 for ; Fri, 3 Jan 2003 06:50:02 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id h03Eo2Q5064131; Fri, 3 Jan 2003 06:50:02 -0800 (PST) Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 62FF737B401 for ; Fri, 3 Jan 2003 06:41:17 -0800 (PST) Received: from mailhub.fokus.gmd.de (mailhub.fokus.gmd.de [193.174.154.14]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1D41A43EC2 for ; Fri, 3 Jan 2003 06:41:16 -0800 (PST) (envelope-from hbb@catssrv.fokus.gmd.de) Received: from catssrv.fokus.gmd.de (catssrv [192.168.229.23]) by mailhub.fokus.gmd.de (8.11.6/8.11.6) with ESMTP id h03EfEJ10726 for ; Fri, 3 Jan 2003 15:41:14 +0100 (MET) Received: from catssrv.fokus.gmd.de (localhost [127.0.0.1]) by catssrv.fokus.gmd.de (8.12.6/8.12.6) with ESMTP id h03EfEx5003599 for ; Fri, 3 Jan 2003 15:41:14 +0100 (CET) (envelope-from hbb@catssrv.fokus.gmd.de) Received: (from hbb@localhost) by catssrv.fokus.gmd.de (8.12.6/8.12.6/Submit) id h03EfD4t003598; Fri, 3 Jan 2003 15:41:13 +0100 (CET) (envelope-from hbb) Message-Id: <200301031441.h03EfD4t003598@catssrv.fokus.gmd.de> Date: Fri, 3 Jan 2003 15:41:13 +0100 (CET) From: Hartmut Brandt Reply-To: Hartmut Brandt To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: sparc64/46729: gethostbyname fails for NIS Sender: owner-freebsd-sparc@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 46729 >Category: sparc64 >Synopsis: gethostbyname fails for NIS >Confidential: no >Severity: critical >Priority: high >Responsible: freebsd-sparc >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Jan 03 06:50:01 PST 2003 >Closed-Date: >Last-Modified: >Originator: Hartmut Brandt >Release: FreeBSD 5.0-CURRENT sparc64 >Organization: FhI Fokus >Environment: System: FreeBSD catssrv.fokus.gmd.de 5.0-CURRENT FreeBSD 5.0-CURRENT #20: Fri Jan 3 14:08:11 CET 2003 hbb@catssrv.fokus.gmd.de:/opt/obj/usr/src/sys/CATSSRV sparc64 >Description: /usr/src/lib/libc/net/gethostbynis.c assumes, that an AF_INET address is the same as an u_long. This is abviously false and leads to the effect, that all IP addresses obtained via NIS are 0.0.0.0. >How-To-Repeat: Execute ping host-with-name-via-nis and observe that ping is able to resolve the name, but the printed address is 0.0.0.0. >Fix: Apply the following patch and recompile and install libc: Index: gethostbynis.c =================================================================== RCS file: /usr/ncvs/src/lib/libc/net/gethostbynis.c,v retrieving revision 1.15 diff -c -r1.15 gethostbynis.c *** gethostbynis.c 22 Mar 2002 21:52:29 -0000 1.15 --- gethostbynis.c 3 Jan 2003 14:31:16 -0000 *************** *** 67,72 **** --- 67,73 ---- static struct hostent h; static char *domain = (char *)NULL; static char ypbuf[YPMAXRECORD + 2]; + in_addr_t addr; switch(af) { case AF_INET: *************** *** 104,110 **** *cp++ = '\0'; h.h_addr_list = host_addrs; h.h_addr = hostaddr; ! *((u_long *)h.h_addr) = inet_addr(result); h.h_length = size; h.h_addrtype = AF_INET; while (*cp == ' ' || *cp == '\t') --- 105,112 ---- *cp++ = '\0'; h.h_addr_list = host_addrs; h.h_addr = hostaddr; ! addr = inet_addr(result); ! bcopy((char *)&addr, h.h_addr, size); h.h_length = size; h.h_addrtype = AF_INET; while (*cp == ' ' || *cp == '\t') >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-sparc" in the body of the message