From owner-freebsd-stable Tue Feb 29 18: 1:21 2000 Delivered-To: freebsd-stable@freebsd.org Received: from waltz.rahul.net (waltz.rahul.net [192.160.13.9]) by hub.freebsd.org (Postfix) with ESMTP id 2D02037BC74 for ; Tue, 29 Feb 2000 18:01:15 -0800 (PST) (envelope-from dhesi@rahul.net) Received: by waltz.rahul.net (Postfix, from userid 104) id 1767999DFA; Tue, 29 Feb 2000 18:01:13 -0800 (PST) To: freebsd-stable@freebsd.org Subject: Re: divert(4) non-working code example Newsgroups: a2i.lists.freebsd-stable References: X-Newsreader: NN version 6.5.1 (NOV) Message-Id: <20000301020113.1767999DFA@waltz.rahul.net> Date: Tue, 29 Feb 2000 18:01:13 -0800 (PST) From: dhesi@rahul.net (Rahul Dhesi) Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Ruslan Ermilov writes: >> Never mind! I searched old mailing list archives and found that >> I needed to do htons(port). What threw me off was that I was >> consulting the natd(8) sources and they didn't bother doing so. >> >Why do you spread such misinformation? >See StrToPort() function in natd(8) sources. I see now that natd does use htons(). However, natd does the conversion between host order and network order in places that are far away from the actual assignment to and from fields in a socket structure. Hard to follow and easy to miss. -- Rahul Dhesi (spam-filtered with RSS and ORBS) See my ORBS faq: http://www.rahul.net/dhesi/orbs.faq.txt To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message