From owner-freebsd-net@FreeBSD.ORG Mon Oct 24 09:50:34 2005 Return-Path: X-Original-To: freebsd-net@freebsd.org Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 72C0A16A41F; Mon, 24 Oct 2005 09:50:34 +0000 (GMT) (envelope-from corecode@fs.ei.tum.de) Received: from stella.fs.ei.tum.de (stella.fs.ei.tum.de [129.187.54.7]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1950843D55; Mon, 24 Oct 2005 09:50:32 +0000 (GMT) (envelope-from corecode@fs.ei.tum.de) Received: from localhost (localhost [127.0.0.1]) by localhost.fs.ei.tum.de (Postfix) with ESMTP id 33B8E8DC3F; Mon, 24 Oct 2005 11:50:31 +0200 (CEST) Received: from stella.fs.ei.tum.de ([127.0.0.1]) by localhost (stella [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 31742-06; Mon, 24 Oct 2005 11:50:31 +0200 (CEST) Received: from [10.150.180.180] (r180180.olydorf.swh.mhn.de [10.150.180.180]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by stella.fs.ei.tum.de (Postfix) with ESMTP id C75CF8D759; Mon, 24 Oct 2005 11:50:30 +0200 (CEST) Message-ID: <435CAE85.2050509@fs.ei.tum.de> Date: Mon, 24 Oct 2005 11:51:01 +0200 From: Simon 'corecode' Schubert User-Agent: Mozilla Thunderbird 1.0.6 (X11/20050912) X-Accept-Language: en-us, en MIME-Version: 1.0 To: kamal kc References: <20051024053532.48332.qmail@web35709.mail.mud.yahoo.com> In-Reply-To: <20051024053532.48332.qmail@web35709.mail.mud.yahoo.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at fs.ei.tum.de Cc: Giorgos Keramidas , freebsd , freebsd Subject: Re: in_cksum() for ip packets with multiple mbufs X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Oct 2005 09:50:34 -0000 kamal kc wrote: > - final thing does this makes any difference > (calling the htons() twice): > > ip->ip_id=htons(ip->ip_id); > ip->ip_id=htons(ip->ip_id); on little endian machines: yes. on big endian machines: no. So don't do it. :) freebsd has several fields of the ip headerin host byte order to speed up access. they get converted to network byte order at a very late stage of the ip output path. cheers simon -- Serve - BSD +++ RENT this banner advert +++ ASCII Ribbon /"\ Work - Mac +++ space for low $$$ NOW!1 +++ Campaign \ / Party Enjoy Relax | http://dragonflybsd.org Against HTML \ Dude 2c 2 the max ! http://golden-apple.biz Mail + News / \