From owner-freebsd-current Fri Apr 3 16:21:04 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id QAA04227 for freebsd-current-outgoing; Fri, 3 Apr 1998 16:21:04 -0800 (PST) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from smtp03.primenet.com (smtp03.primenet.com [206.165.6.133]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id QAA04219 for ; Fri, 3 Apr 1998 16:21:03 -0800 (PST) (envelope-from tlambert@usr06.primenet.com) Received: (from daemon@localhost) by smtp03.primenet.com (8.8.8/8.8.8) id RAA29997 for ; Fri, 3 Apr 1998 17:21:02 -0700 (MST) Received: from usr06.primenet.com(206.165.6.206) via SMTP by smtp03.primenet.com, id smtpd029983; Fri Apr 3 17:20:59 1998 Received: (from tlambert@localhost) by usr06.primenet.com (8.8.5/8.8.5) id RAA13459 for current@freebsd.org; Fri, 3 Apr 1998 17:20:59 -0700 (MST) From: Terry Lambert Message-Id: <199804040020.RAA13459@usr06.primenet.com> Subject: BUG in getnetent(3) and family? To: current@FreeBSD.ORG Date: Sat, 4 Apr 1998 00:20:59 +0000 (GMT) X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG I think there is a bug in getnetent(3) and family's representation of the value of the n_net field. Specifically, if I: struct netent *nep; struct in_addr in; while( ( nep = getnetent()) != NULL) { printf( "n_name: %s\n", nep->n_name); in.s_addr = htonl(nep->n_net); printf( "n_net: %s\n", inet_ntoa(in)); } And /etc/networks contains: your-net 127 # your comment your-netmask 255.255.255 # subnet mask for your-net subnet1 127.0.1 alias1 # comment 1 subnet2 127.0.2 alias2 # comment 2 The ouput I get is: n_name: your-net n_net: 0.0.0.127 n_name: your-netmask n_net: 0.255.255.255 n_name: subnet1 n_net: 0.127.0.1 n_name: subnet2 n_net: 0.127.0.2 Pretty obviously, missing tuples aren't being expanded, per the RFC and per the man page?!? Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message