Re: [PATCH] IPv6: only modify checksum for UDP

2006-11-13 Thread David Miller
From: David Stevens [EMAIL PROTECTED] Date: Fri, 10 Nov 2006 09:54:58 -0800 The Internet checksum is defined as a 1's-complement sum, so if the alternate 0 does not have a special meaning in a protocol, then by 1's-complement arithmetic, 0 == ~0. So, it looks to me without the

Re: [PATCH] IPv6: only modify checksum for UDP

2006-11-13 Thread Al Viro
On Mon, Nov 13, 2006 at 04:50:58PM -0800, David Miller wrote: From: David Stevens [EMAIL PROTECTED] Date: Fri, 10 Nov 2006 09:54:58 -0800 The Internet checksum is defined as a 1's-complement sum, so if the alternate 0 does not have a special meaning in a protocol, then by 1's-complement

Re: [PATCH] IPv6: only modify checksum for UDP

2006-11-13 Thread David Stevens
David Miller [EMAIL PROTECTED] wrote on 11/13/2006 04:50:58 PM: Puzzling :-) Then why is the transformation only performed for UDP in the ipv4 stack? It seems by your logic TCP would need to either do the if (sum==0) sum=~0; thing or it would need to accept both 0 and ~0 in the checksum

Re: [PATCH] IPv6: only modify checksum for UDP

2006-11-13 Thread Al Viro
On Mon, Nov 13, 2006 at 05:44:12PM -0800, David Stevens wrote: That's actually what I was suggesting. In 1's-complement, ~0 == -0 which is still 0, so barring any special case (like UDP's 0 means no checksum rule), it should be equally valid for a packet to have 0 or ~0 as the checksum

Re: [PATCH] IPv6: only modify checksum for UDP

2006-11-11 Thread Brian Haley
This is a discussion about Brian's SECOND PATCH which needs fixups. Please forget about the second patch, optimizing this code path isn't worth it if the -1 trick doesn't work in all cases. -Brian - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to

[PATCH] IPv6: only modify checksum for UDP

2006-11-10 Thread Brian Haley
Only change upper-layer checksum from 0 to 0x for UDP (as RFC 768 states), not for others as RFC 4443 doesn't require it. Signed-off-by: Brian Haley [EMAIL PROTECTED] diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c index 81bd45b..dbb9b1f 100644 --- a/net/ipv6/icmp.c +++ b/net/ipv6/icmp.c @@

Re: [PATCH] IPv6: only modify checksum for UDP

2006-11-10 Thread David Stevens
Sorry, I saw this discussion a little late... The Internet checksum is defined as a 1's-complement sum, so if the alternate 0 does not have a special meaning in a protocol, then by 1's-complement arithmetic, 0 == ~0. So, it looks to me without the remapping that a valid checksum may also

Re: [PATCH] IPv6: only modify checksum for UDP

2006-11-10 Thread David Miller
From: Brian Haley [EMAIL PROTECTED] Date: Fri, 10 Nov 2006 11:24:45 -0500 Only change upper-layer checksum from 0 to 0x for UDP (as RFC 768 states), not for others as RFC 4443 doesn't require it. Signed-off-by: Brian Haley [EMAIL PROTECTED] Applied, thanks Brian. - To unsubscribe from

Re: [PATCH] IPv6: only modify checksum for UDP

2006-11-10 Thread Nivedita Singhvi
David Miller wrote: From: Brian Haley [EMAIL PROTECTED] Date: Fri, 10 Nov 2006 11:24:45 -0500 Only change upper-layer checksum from 0 to 0x for UDP (as RFC 768 states), not for others as RFC 4443 doesn't require it. Signed-off-by: Brian Haley [EMAIL PROTECTED] Applied, thanks Brian.

Re: [PATCH] IPv6: only modify checksum for UDP

2006-11-10 Thread David Miller
From: Nivedita Singhvi [EMAIL PROTECTED] Date: Fri, 10 Nov 2006 15:17:06 -0800 WATCH YOUR QUOTING! David Miller wrote: From: Brian Haley [EMAIL PROTECTED] Date: Fri, 10 Nov 2006 11:24:45 -0500 Only change upper-layer checksum from 0 to 0x for UDP (as RFC 768 states), not for

Re: [PATCH] IPv6: only modify checksum for UDP

2006-11-10 Thread Nivedita Singhvi
David Miller wrote: From: Nivedita Singhvi [EMAIL PROTECTED] Date: Fri, 10 Nov 2006 15:17:06 -0800 WATCH YOUR QUOTING! That explains it! Arg! Sorry, DaveM, a bit on autopilot trying to put some tests together.. thanks, Nivedita - To unsubscribe from this list: send the line unsubscribe