Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 3 Jan 1998 18:12:00 -0500 (EST)
From:      Joe Traister <traister@mojozone.org>
To:        Steve Price <sprice@HiWAAY.net>
Cc:        freebsd-bugs@hub.freebsd.org
Subject:   Re: bin/5419: timed rejects valid networks with -n
Message-ID:  <Pine.NEB.3.96.980103180048.1001A-100000@manta.mojozone.org>
In-Reply-To: <199801031950.LAA29350@hub.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
-----BEGIN PGP SIGNED MESSAGE-----

On Sat, 3 Jan 1998, Steve Price wrote:

>  I am no timed(8) expert.  In fact, I have never used it.  Just from
>  looking at the code it appears that if the above fix is appropriate
>  then it should also be supplemented with the following patch.  I'm
>  just guessing here, so don't shoot me if I'm wrong. :)
>  
>  Steve
>  
>  @@ -420,7 +420,7 @@
>   		ntp->dest_addr.sin_port = port;
>   
>   		for (nt = nets; nt; nt = nt->next) {
>  -			if (ntp->net.s_addr == htonl(nt->net))
>  +			if (ntp->net.s_addr == nt->net)
>   				break;
>   		}
>   		if ((nflag && !nt) || (iflag && nt))

Unfortunately, this will not work.  The nt->net element gets set by either
getnetbyname(3) or inet_network(3).  getnetbyname(3) returns its data in
host byte order while all other routines that return network addresses
(including inet_network(3)) return network addresses in network byte
order.  Since the code only tests equality of the addresses and doesn't
depend on the byte order used, it is sufficient to make sure that only one
byte order is used to store the addresses.  Otherwise the htonl()  and
ntohl() macros would need to be used all over the code. 

- --
Joe Traister       | He had that rare weird electricity about him -- that
traister@gate.net  | extremely wild and heavy presence that you only see in
CyberGate SysAdmin | a person who has abandoned all hope of ever behaving
finger for PGP key | "normally."  -- Hunter S. Thompson

-----BEGIN PGP SIGNATURE-----
Version: 2.6.3
Charset: noconv

iQCVAwUBNK7FyCLR+wTS7lx1AQFw/AQAiN2Pd7QSrW9Cn+x/7iL9lgwR96QsHHN8
ZhoRu9U0yiJZZQuDjmVOYoJaVgG9erfGFe6c7UQemCWgG9Ef95yJH+ArwkiWRUQp
n1QwnkSGOobLpDnw/Jbv6o+oebzaXu0Nadn8SBC2npTtmMrWVBVZBqjsCnOBsIMU
ZmfOWfNbBbA=
=bUfS
-----END PGP SIGNATURE-----




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.NEB.3.96.980103180048.1001A-100000>