All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brian Haley <brian.haley@hp.com>
To: David Miller <davem@davemloft.net>
Cc: viro@ftp.linux.org.uk, netdev@vger.kernel.org
Subject: [PATCH] IPv6: only modify checksum for UDP
Date: Fri, 10 Nov 2006 11:24:45 -0500	[thread overview]
Message-ID: <4554A7CD.6040907@hp.com> (raw)
In-Reply-To: <20061109.151402.15590179.davem@davemloft.net>

[-- Attachment #1: Type: text/plain, Size: 176 bytes --]

Only change upper-layer checksum from 0 to 0xFFFF for UDP (as RFC 768 
states), not for others as RFC 4443 doesn't require it.

Signed-off-by: Brian Haley <brian.haley@hp.com>

[-- Attachment #2: cksum.zero.diff --]
[-- Type: text/x-patch, Size: 721 bytes --]

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
@@ -246,8 +246,6 @@ static int icmpv6_push_pending_frames(st
 					   len, fl->proto, tmp_csum);
 		icmp6h->icmp6_cksum = tmp_csum;
 	}
-	if (icmp6h->icmp6_cksum == 0)
-		icmp6h->icmp6_cksum = -1;
 	ip6_push_pending_frames(sk);
 out:
 	return err;
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c
index 6bc6655..baf7b82 100644
--- a/net/ipv6/raw.c
+++ b/net/ipv6/raw.c
@@ -536,7 +536,7 @@ static int rawv6_push_pending_frames(str
 				   &fl->fl6_dst,
 				   total_len, fl->proto, tmp_csum);
 
-	if (tmp_csum == 0)
+	if (tmp_csum == 0 && fl->proto == IPPROTO_UDP)
 		tmp_csum = -1;
 
 	csum = tmp_csum;

  reply	other threads:[~2006-11-10 16:24 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-08 22:13 why do we mangle checksums for v6 ICMP? Al Viro
2006-11-08 22:28 ` Al Viro
2006-11-09 17:32 ` Brian Haley
2006-11-09 23:14   ` David Miller
2006-11-10 16:24     ` Brian Haley [this message]
2006-11-10 17:54       ` [PATCH] IPv6: only modify checksum for UDP David Stevens
2006-11-14  0:50         ` David Miller
2006-11-14  1:18           ` Al Viro
2006-11-14  1:44           ` David Stevens
2006-11-14  1:52             ` Al Viro
2006-11-10 22:55       ` David Miller
2006-11-10 23:17         ` Nivedita Singhvi
2006-11-10 23:26           ` David Miller
2006-11-10 23:36             ` Nivedita Singhvi
2006-11-12  1:30             ` Brian Haley
2006-11-10 16:25     ` [PATCH] IPv6: optimize echo reply checksum calculation Brian Haley
2006-11-10 17:34       ` Al Viro
2006-11-10 17:51         ` Brian Haley
2006-11-10 18:05           ` Al Viro
2006-11-10 18:20             ` Al Viro
2006-11-10 19:04               ` Brian Haley
2006-11-10 19:17                 ` Al Viro
2006-11-10 21:06                   ` Brian Haley
2006-11-11  1:45                     ` Al Viro
2006-11-11 18:07     ` why do we mangle checksums for v6 ICMP? Bill Fink
2006-11-13  7:04       ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4554A7CD.6040907@hp.com \
    --to=brian.haley@hp.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=viro@ftp.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.