Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 21 Apr 1996 22:26:10 +0200 (MET DST)
From:      Luigi Rizzo <luigi@labinfo.iet.unipi.it>
To:        darrenr@vitruvius.arbld.unimelb.edu.au (Darren Reed)
Cc:        hackers@FreeBSD.ORG
Subject:   Re: one less checksum ? (fwd)
Message-ID:  <199604212026.WAA29029@labinfo.iet.unipi.it>
In-Reply-To: <199604211351.XAA10529@vitruvius.arbld.unimelb.EDU.AU> from "Darren Reed" at Apr 21, 96 11:50:44 pm

next in thread | previous in thread | raw e-mail | index | archive | help
> Is there any reason why the result of in_cksum() is stored in ip_sum in
> ipintr() ?
> 
> A small gain can be observed if this is not done, for forwarded packets,
> by altering the checksum in ip_output() if IP_FORWARDING is set rather
> than recalculating the entire header checksum.  Is this worthwhile ?

TCP/IP Illustrated vol.1 suggests something similar, so I'd say it is
worthwhile. Garret Wollman should be looking after this code right in
these days.

But I don't understand how you relate your code (which looks correct)
with the above comment. It looks like your code is computing the
checksum in the same place, just with a more efficient algorithm.

The same code fragments suggest some more optimizations when
if_forwarding is enabled, e.g. don't convert header fields (ip_len and
ip_off) for back and forth from network format.

	Luigi



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