TCP Checksums in mbufs

2007-01-08 Thread Lee Brotherston
Hi, I have a bit of code I have written that uses pfil to access network traffic as it passes between interfaces on a FreeBSD router. One of the functions it performs is some incredibly basic rewrites of certain packets (keeping the same length, so no issues about sequence numbers), but it does

Re: TCP Checksums in mbufs

2007-01-08 Thread Julian Elischer
Lee Brotherston wrote: Hi, I have a bit of code I have written that uses pfil to access network traffic as it passes between interfaces on a FreeBSD router. One of the functions it performs is some incredibly basic rewrites of certain packets (keeping the same length, so no issues about

Re: TCP Checksums in mbufs

2007-01-08 Thread Lowell Gilbert
Julian Elischer [EMAIL PROTECTED] writes: Lee Brotherston wrote: Hi, I have a bit of code I have written that uses pfil to access network traffic as it passes between interfaces on a FreeBSD router. One of the functions it performs is some incredibly basic rewrites of certain packets

Re: TCP Checksums in mbufs

2007-01-08 Thread Lowell Gilbert
Julian Elischer [EMAIL PROTECTED] writes: Lee Brotherston wrote: Hi, I have a bit of code I have written that uses pfil to access network traffic as it passes between interfaces on a FreeBSD router. One of the functions it performs is some incredibly basic rewrites of certain packets

Re: TCP Checksums in mbufs

2007-01-08 Thread Lee Brotherston
On Mon, Jan 08, 2007 at 02:00:14PM -0800, Julian Elischer wrote: there is an algorythm to recalculate the tcp/ip checksum when you replace a byte. you subtract the old value from the csum and add the new one, but not quite a as easy as that. I think it's given in one of the RFCs but I

Re: TCP Checksums in mbufs

2007-01-08 Thread Julian Elischer
Lowell Gilbert wrote: Actually, it is as easy as that. And it's exactly the way this kind of case is usually handled. almost.. you need to account for the fact that our computers are 2-s compliment machines and the checksum is a 1-s compliment checksum I think it's given in one of the