Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 24 Oct 2005 11:51:01 +0200
From:      Simon 'corecode' Schubert <corecode@fs.ei.tum.de>
To:        kamal kc <kamal_ckk@yahoo.com>
Cc:        Giorgos Keramidas <keramida@ceid.upatras.gr>, freebsd <freebsd-hackers@freebsd.org>, freebsd <freebsd-net@freebsd.org>
Subject:   Re: in_cksum() for ip packets with multiple mbufs
Message-ID:  <435CAE85.2050509@fs.ei.tum.de>
In-Reply-To: <20051024053532.48332.qmail@web35709.mail.mud.yahoo.com>
References:  <20051024053532.48332.qmail@web35709.mail.mud.yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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   / \



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?435CAE85.2050509>