From owner-freebsd-bugs Sat Jan 3 07:00:08 1998 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id HAA14511 for bugs-outgoing; Sat, 3 Jan 1998 07:00:08 -0800 (PST) (envelope-from owner-freebsd-bugs) Received: (from gnats@localhost) by hub.freebsd.org (8.8.7/8.8.7) id HAA14481; Sat, 3 Jan 1998 07:00:01 -0800 (PST) (envelope-from gnats) Resent-Date: Sat, 3 Jan 1998 07:00:01 -0800 (PST) Resent-Message-Id: <199801031500.HAA14481@hub.freebsd.org> Resent-From: gnats (GNATS Management) Resent-To: freebsd-bugs Resent-Reply-To: FreeBSD-gnats@FreeBSD.ORG, traister@mojozone.org Received: from manta.mojozone.org (root@dffl0-5.gate.net [199.227.254.68]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id GAA14265 for ; Sat, 3 Jan 1998 06:52:54 -0800 (PST) (envelope-from traister@manta.mojozone.org) Received: (from traister@localhost) by manta.mojozone.org (8.8.7/8.8.7) id JAA00444; Sat, 3 Jan 1998 09:52:52 -0500 (EST) Message-Id: <199801031452.JAA00444@manta.mojozone.org> Date: Sat, 3 Jan 1998 09:52:52 -0500 (EST) From: Joe Traister Reply-To: traister@mojozone.org To: FreeBSD-gnats-submit@FreeBSD.ORG X-Send-Pr-Version: 3.2 Subject: bin/5419: timed rejects valid networks with -n Sender: owner-freebsd-bugs@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk >Number: 5419 >Category: bin >Synopsis: timed rejects valid networks with -n >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Jan 3 07:00:01 PST 1998 >Last-Modified: >Originator: Joe Traister >Organization: None >Release: FreeBSD 2.2.2-RELEASE i386 >Environment: FreeBSD-2.2.2 through FreeBSD-current >Description: When given -n followed by a network name or number, timed exits with "timed: no network usable". This is due to the fact that getnetbyname(3) returns a struct with network numbers in host byte order, rather than network byte order. This is correct behavior for getnetbyname(3) according to its man page. >How-To-Repeat: timed -n where is a valid, directly-connected network address. >Fix: --- timed.c.dist Fri Jan 2 22:14:01 1998 +++ timed.c Fri Jan 2 22:14:25 1998 @@ -364,7 +364,7 @@ nentp = getnetbyaddr(nt->net, AF_INET); } if (nentp != 0) { - nt->net = nentp->n_net; + nt->net = htonl(nentp->n_net); } else if (nt->net == INADDR_NONE) { fprintf(stderr, "timed: unknown net %s\n", nt->name); exit(1); >Audit-Trail: >Unformatted: