Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 03 May 1998 17:07:30 -0700
From:      David Greenman <dg@root.com>
To:        Pierre Beyssac <pb@fasterix.freenix.org>
Cc:        freebsd-net@FreeBSD.ORG
Subject:   Re: patches for fast forwarding (with kernel option & sysctl) 
Message-ID:  <199805040007.RAA02612@implode.root.com>
In-Reply-To: Your message of "Mon, 04 May 1998 01:43:10 %2B0200." <19980504014310.A22037@fasterix.frmug.fr.net> 

next in thread | previous in thread | raw e-mail | index | archive | help
Here are new patches to use NetBSD's IPFLOW stuff on -current. To
use, store ipflow.c in /sys/netinet, then add IPFLOW to your kernel
config. After booting, activate with:

   These appear to contain the broken header checksumming code. That'll need
to be fixed before these are integrated. There is a NetBSD #5380 open on 
this - author Dennis Ferguson <dennis@juniper.net>.

Text from PR#5380 for proposed fix:

>Given an htons() macro which compiles to a constant with a constant
>argument the following code fragment avoids generating a 0xffff
>checksum, produces a correct checksum in all cases, avoids the #if's,
>and does the operation with a single comparison and addition on
>machines of either byte order.
>
>	ip->ip_ttl -= IPTTLDEC;
>	if (ip->ip_sum >= htons(0xffff - (IPTTLDEC << 8))) {
>		ip->ip_sum += htons(IPTTLDEC << 8) + 1;
>	} else {
>		ip->ip_sum += htons(IPTTLDEC << 8);
>	}


-DG

David Greenman
Co-founder/Principal Architect, The FreeBSD Project

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-net" in the body of the message



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