From bob@luke.pmr.com  Thu Jun 19 11:28:52 1997
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 LAA10059
          for <FreeBSD-gnats-submit@freebsd.org>; Thu, 19 Jun 1997 11:28:50 -0700 (PDT)
Received: (from bob@localhost) by luke.pmr.com (8.8.5/8.7.3) id NAA16503; Thu, 19 Jun 1997 13:28:40 -0500 (CDT)
Message-Id: <199706191828.NAA16503@luke.pmr.com>
Date: Thu, 19 Jun 1997 13:28:40 -0500 (CDT)
From: Bob Willcox <bob@luke.pmr.com>
Reply-To: bob@luke.pmr.com
To: FreeBSD-gnats-submit@freebsd.org
Subject: Bug in timed with -n & -i flags
X-Send-Pr-Version: 3.2

>Number:         3906
>Category:       bin
>Synopsis:       timed mishandles network numbers
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jun 19 11:30:01 PDT 1997
>Closed-Date:    Thu Aug 21 12:56:16 PDT 1997
>Last-Modified:  Thu Aug 21 12:57:50 PDT 1997
>Originator:     Bob Willcox
>Release:        FreeBSD 2.2.2-RELEASE i386
>Organization:
Power Micro Research
>Environment:
Running timed on multi-homed host
>Description:
Timed fails to convert network numbers specified via the -n or -i flags into
network byte order and therefore does not find these networks.
>How-To-Repeat:
Execute timed with a valid network specification for the -n flag.  It will
not find the network and fail to start.
>Fix:
Here is a patch:

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)

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: jlemon 
State-Changed-When: Thu Aug 21 12:56:16 PDT 1997 
State-Changed-Why:  

Suggested fix applied to timed.c, rev 1.4, 1.2, thanks! 
>Unformatted:
