Date: Sat, 06 Dec 1997 14:35:18 +0000 From: Brian Somers <brian@awfulhak.org> To: Julian Elischer <julian@whistle.com> Cc: Ari Suutari <ari@suutari.iki.fi>, Eivind Eklund <perhaps@yes.no>, John Kelly <jak@cetlink.net>, current@freebsd.org Subject: Re: 3.0 -release ? Message-ID: <199712061435.OAA27381@awfulhak.demon.co.uk> In-Reply-To: Your message of "Fri, 05 Dec 1997 14:04:11 PST." <Pine.BSF.3.95.971205135942.15892B-100000@current1.whistle.com>
next in thread | previous in thread | raw e-mail | index | archive | help
> This is a mess. I am half way through making up some patches to fix it > properly. (literally I have a window at work with the half-editted sources > on it :) > > htons will correctly smash up the lower 16 bits of a long under > a little-endian OS. so using htons, while being totoally un-portable > will probably work, but htonl will > do the correct thing, and the lower 16 bits of the port will become 0. > The correct answer is to change teh port numbers where-ever they > are in natd to be unsigned short. > I am doing this.. > I'll add the changes in a few days. For the time being, I've put back the htons() :-/ As you say, this code ain't portable. Our original number goes from a,b,c,d to b,a,0,0 and then gets coerced into a u_short.... two wrongs make a right :-O -- Brian <brian@Awfulhak.org>, <brian@FreeBSD.org>, <brian@OpenBSD.org> <http://www.Awfulhak.org> Don't _EVER_ lose your sense of humour....
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199712061435.OAA27381>