From owner-freebsd-bugs Thu Jun 19 08:26:21 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id IAA02227 for bugs-outgoing; Thu, 19 Jun 1997 08:26:21 -0700 (PDT) Received: from luke.pmr.com (luke.pmr.com [206.224.65.132]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id IAA02219 for ; Thu, 19 Jun 1997 08:26:13 -0700 (PDT) Received: (from bob@localhost) by luke.pmr.com (8.8.5/8.7.3) id KAA14597; Thu, 19 Jun 1997 10:25:50 -0500 (CDT) Message-ID: <19970619102550.20418@luke.pmr.com> Date: Thu, 19 Jun 1997 10:25:50 -0500 From: Bob Willcox To: bugs list Subject: Minor timed bug with patch Reply-To: Bob Willcox Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.76e Sender: owner-bugs@freebsd.org X-Loop: FreeBSD.org Precedence: bulk I discovered a bug in timed's handling of network addresses (-n and -i flags) where it forgets to convert the network address to network format when comparing it to one that is. I suspect that this bug exists in all versions (I know it is in 2.1.7.1, 2.2.2, and current). Here is a patch to fix it: Index: usr.sbin/timed/timed/timed.c =================================================================== RCS file: /usr/cvs/FreeBSD/src/usr.sbin/timed/timed/timed.c,v retrieving revision 1.2 diff -u -r1.2 timed.c --- timed.c 1995/05/15 09:56:49 1.2 +++ timed.c 1997/06/19 04:45:34 @@ -452,7 +452,7 @@ ntp->dest_addr.sin_port = port; for (nt = nets; nt; nt = nt->next) { - if (ntp->net.s_addr == nt->net) + if (ntp->net.s_addr == htonl(nt->net)) break; } if (nflag && !nt || iflag && nt) -- Bob Willcox Deliberation, n.: The act of examining one's bread to determine bob@luke.pmr.com which side it is buttered on. Austin, TX -- Ambrose Bierce, "The Devil's Dictionary"