From owner-freebsd-current Sat Dec 6 06:38:48 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id GAA22297 for current-outgoing; Sat, 6 Dec 1997 06:38:48 -0800 (PST) (envelope-from owner-freebsd-current) Received: from awfulhak.demon.co.uk (awfulhak.demon.co.uk [158.152.17.1]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id GAA22280 for ; Sat, 6 Dec 1997 06:38:34 -0800 (PST) (envelope-from brian@awfulhak.org) Received: from gate.lan.awfulhak.org (localhost [127.0.0.1]) by awfulhak.demon.co.uk (8.8.7/8.8.7) with ESMTP id OAA27381; Sat, 6 Dec 1997 14:35:18 GMT (envelope-from brian@gate.lan.awfulhak.org) Message-Id: <199712061435.OAA27381@awfulhak.demon.co.uk> X-Mailer: exmh version 2.0zeta 7/24/97 To: Julian Elischer cc: Ari Suutari , Eivind Eklund , John Kelly , current@freebsd.org Subject: Re: 3.0 -release ? In-reply-to: Your message of "Fri, 05 Dec 1997 14:04:11 PST." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 06 Dec 1997 14:35:18 +0000 From: Brian Somers Sender: owner-freebsd-current@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > 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 , , Don't _EVER_ lose your sense of humour....