All of lore.kernel.org
 help / color / mirror / Atom feed
From: Frederik Deweerdt <deweerdt@free.fr>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org, davem@davemloft.net
Subject: [-mm patch] remove tcp header from tcp_v4_check
Date: Thu, 11 Jan 2007 18:28:49 +0000	[thread overview]
Message-ID: <20070111182849.GA5941@slug> (raw)
In-Reply-To: <20070104220200.ae4e9a46.akpm@osdl.org>

On Thu, Jan 04, 2007 at 10:02:00PM -0800, Andrew Morton wrote:
> 
> 	ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.20-rc3/2.6.20-rc3-mm1/
> 
The tcphdr struct passed to tcp_v4_check is not used, the following patch
removes it from the parameter list.

Regards,
Frederik


Signed-off-by: Frederik Deweerdt <frederik.deweerdt@gmail.com>


Index: 2.6.20-rc3-mm1/include/net/tcp.h
===================================================================
--- 2.6.20-rc3-mm1.orig/include/net/tcp.h
+++ 2.6.20-rc3-mm1/include/net/tcp.h
@@ -802,9 +802,8 @@ static inline void tcp_update_wl(struct 
 /*
  * Calculate(/check) TCP checksum
  */
-static inline __sum16 tcp_v4_check(struct tcphdr *th, int len,
-			       __be32 saddr, __be32 daddr,
-			       __wsum base)
+static inline __sum16 tcp_v4_check(int len, __be32 saddr,
+				   __be32 daddr, __wsum base)
 {
 	return csum_tcpudp_magic(saddr,daddr,len,IPPROTO_TCP,base);
 }
Index: 2.6.20-rc3-mm1/net/ipv4/netfilter/ipt_REJECT.c
===================================================================
--- 2.6.20-rc3-mm1.orig/net/ipv4/netfilter/ipt_REJECT.c
+++ 2.6.20-rc3-mm1/net/ipv4/netfilter/ipt_REJECT.c
@@ -116,7 +116,7 @@ static void send_reset(struct sk_buff *o
 
 	/* Adjust TCP checksum */
 	tcph->check = 0;
-	tcph->check = tcp_v4_check(tcph, sizeof(struct tcphdr),
+	tcph->check = tcp_v4_check(sizeof(struct tcphdr),
 				   nskb->nh.iph->saddr,
 				   nskb->nh.iph->daddr,
 				   csum_partial((char *)tcph,
Index: 2.6.20-rc3-mm1/net/ipv4/tcp_ipv4.c
===================================================================
--- 2.6.20-rc3-mm1.orig/net/ipv4/tcp_ipv4.c
+++ 2.6.20-rc3-mm1/net/ipv4/tcp_ipv4.c
@@ -502,14 +502,13 @@ void tcp_v4_send_check(struct sock *sk, 
 	struct tcphdr *th = skb->h.th;
 
 	if (skb->ip_summed == CHECKSUM_PARTIAL) {
-		th->check = ~tcp_v4_check(th, len,
-					  inet->saddr, inet->daddr, 0);
+		th->check = ~tcp_v4_check(len, inet->saddr,
+					  inet->daddr, 0);
 		skb->csum_offset = offsetof(struct tcphdr, check);
 	} else {
-		th->check = tcp_v4_check(th, len, inet->saddr, inet->daddr,
+		th->check = tcp_v4_check(len, inet->saddr, inet->daddr,
 					 csum_partial((char *)th,
-						      th->doff << 2,
-						      skb->csum));
+						th->doff << 2, skb->csum));
 	}
 }
 
@@ -525,7 +524,7 @@ int tcp_v4_gso_send_check(struct sk_buff
 	th = skb->h.th;
 
 	th->check = 0;
-	th->check = ~tcp_v4_check(th, skb->len, iph->saddr, iph->daddr, 0);
+	th->check = ~tcp_v4_check(skb->len, iph->saddr, iph->daddr, 0);
 	skb->csum_offset = offsetof(struct tcphdr, check);
 	skb->ip_summed = CHECKSUM_PARTIAL;
 	return 0;
@@ -747,7 +746,7 @@ static int tcp_v4_send_synack(struct soc
 	if (skb) {
 		struct tcphdr *th = skb->h.th;
 
-		th->check = tcp_v4_check(th, skb->len,
+		th->check = tcp_v4_check(skb->len,
 					 ireq->loc_addr,
 					 ireq->rmt_addr,
 					 csum_partial((char *)th, skb->len,
@@ -1514,7 +1513,7 @@ static struct sock *tcp_v4_hnd_req(struc
 static __sum16 tcp_v4_checksum_init(struct sk_buff *skb)
 {
 	if (skb->ip_summed == CHECKSUM_COMPLETE) {
-		if (!tcp_v4_check(skb->h.th, skb->len, skb->nh.iph->saddr,
+		if (!tcp_v4_check(skb->len, skb->nh.iph->saddr,
 				  skb->nh.iph->daddr, skb->csum)) {
 			skb->ip_summed = CHECKSUM_UNNECESSARY;
 			return 0;

  parent reply	other threads:[~2007-01-11 18:31 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-05  6:02 2.6.20-rc3-mm1 Andrew Morton
2007-01-05  9:44 ` [-mm patch] lockdep: unbalance at generic_sync_sb_inodes Frederik Deweerdt
2007-01-05 12:16 ` [-mm patch] lockdep: possible deadlock in sysfs Frederik Deweerdt
2007-01-05 12:48   ` Oliver Neukum
2007-01-05 15:13   ` Oliver Neukum
2007-01-05 16:42     ` Frederik Deweerdt
2007-01-05 16:53       ` Oliver Neukum
2007-01-05 16:23 ` 2.6.20-rc3-mm1 Mariusz Kozlowski
2007-01-05 16:23   ` 2.6.20-rc3-mm1 Mariusz Kozlowski
2007-01-05 18:45   ` 2.6.20-rc3-mm1 Tim Schmielau
2007-01-05 18:45     ` 2.6.20-rc3-mm1 Tim Schmielau
2007-01-08 12:36     ` 2.6.20-rc3-mm1 Mariusz Kozlowski
2007-01-08 12:36       ` 2.6.20-rc3-mm1 Mariusz Kozlowski
2007-01-05 20:55   ` 2.6.20-rc3-mm1 Benjamin Herrenschmidt
2007-01-05 21:15     ` 2.6.20-rc3-mm1 Andrew Morton
2007-01-05 21:15       ` 2.6.20-rc3-mm1 Andrew Morton
2007-01-05 21:24       ` 2.6.20-rc3-mm1 Benjamin Herrenschmidt
2007-01-05 21:24         ` 2.6.20-rc3-mm1 Benjamin Herrenschmidt
2007-01-08 19:32         ` 2.6.20-rc3-mm1 Cornelia Huck
2007-01-08 19:32           ` 2.6.20-rc3-mm1 Cornelia Huck
2007-01-08 21:19           ` 2.6.20-rc3-mm1 Benjamin Herrenschmidt
2007-01-08 21:19             ` 2.6.20-rc3-mm1 Benjamin Herrenschmidt
2007-01-06  1:07 ` [-mm patch] make proc_dointvec_taint() static Adrian Bunk
2007-01-06 10:58 ` 2.6.20-rc3-mm1: umount reiser4 FS stuck in D state Laurent Riffard
2007-01-06 14:12   ` Laurent Riffard
2007-01-06 16:37   ` Jens Axboe
2007-01-06 18:58   ` Vladimir V. Saveliev
2007-01-12 22:56     ` Laurent Riffard
2007-01-23 16:40       ` Vladimir V. Saveliev
2007-01-23 15:46         ` Jens Axboe
2007-01-23 18:21           ` Laurent Riffard
2007-02-01 20:04             ` Edward Shishkin
2007-02-01 20:42               ` Laurent Riffard
2007-02-01 21:52                 ` Edward Shishkin
2007-02-02 21:13                   ` Laurent Riffard
2007-01-06 12:55 ` 2.6.20-rc3-mm1 - git-block.patch causes hard lockups Valdis.Kletnieks
2007-01-08  8:55   ` Jens Axboe
2007-01-09 18:03     ` Valdis.Kletnieks
2007-01-06 13:44 ` 2.6.20-rc3-mm1 - rewrite-lock-in-cpufreq-to-eliminate-cpufreq-hotplug-related-issues.patch Valdis.Kletnieks
2007-01-06 16:59   ` Mattia Dongili
2007-01-07  0:29     ` Valdis.Kletnieks
2007-01-06 15:20 ` 2.6.20-rc3-mm1 - reiser4-sb_sync_inodes.patch causes boot hang Valdis.Kletnieks
2007-01-06 19:14   ` Andrew Morton
2007-01-07  0:28     ` Valdis.Kletnieks
2007-01-09 14:40 ` [Re: 2.6.20-rc3-mm1] BUG: at kernel/sched.c:3415 sub_preempt_count() Maciej Rutecki
2007-01-09 15:28   ` Frederik Deweerdt
2007-01-09 20:50     ` Maciej Rutecki
2007-01-09 21:06       ` Frederik Deweerdt
2007-01-10 16:54         ` Maciej Rutecki
2007-01-11 18:28 ` Frederik Deweerdt [this message]
  -- strict thread matches above, loose matches on Subject: below --
2007-01-12  6:26 2.6.20-rc4-mm1 Andrew Morton
2007-01-12 13:33 ` [-mm patch] remove tcp header from tcp_v4_check Frederik Deweerdt

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=20070111182849.GA5941@slug \
    --to=deweerdt@free.fr \
    --cc=akpm@osdl.org \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    /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.