From owner-cvs-lib Sat Mar 23 14:16:44 1996 Return-Path: owner-cvs-lib Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id OAA15668 for cvs-lib-outgoing; Sat, 23 Mar 1996 14:16:44 -0800 (PST) Received: (from wpaul@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id OAA15648 Sat, 23 Mar 1996 14:16:28 -0800 (PST) Date: Sat, 23 Mar 1996 14:16:28 -0800 (PST) From: Bill Paul Message-Id: <199603232216.OAA15648@freefall.freebsd.org> To: CVS-committers, cvs-all, cvs-lib Subject: cvs commit: src/lib/libc/net getnetbynis.c Sender: owner-cvs-lib@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk wpaul 96/03/23 14:16:27 Modified: lib/libc/net getnetbynis.c Log: Fix other half of problem reported in PR #1079: _getnetbynisaddr() is broken. The translation from network number to ASCII string was not working correctly (you would sometimes get things like 0.244.0.0 instead of 244.0.0). Also copied results of yp_match() to a static buffer for consistency with gethostbynis.c. Note: _getnetbynisaddr() chops off trailing .0's, i.e. 244.0.0 is truncated to 244. By contrast, getnetbyht.c code (for local /etc/networks lookups) leaves the traling .0's in place. This means that the NIS and local file lookups will match different things when looking up the same network number. I'm not sure which is the correct behavior. (I think the DNS lookup code tries all combinations -- should the NIS and local host lookup routines do that too?) Revision Changes Path 1.5 +41 -12 src/lib/libc/net/getnetbynis.c