diff options
author | Frederik Deweerdt <frederik.deweerdt@gmail.com> | 2007-02-04 23:15:27 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-02-08 15:38:44 -0500 |
commit | ba7808eac17360dda459f82222859b0e3879854b (patch) | |
tree | b9774fb03694e7e019d57c6f0b306cdd1232d4d2 /net | |
parent | a0d78ebf3a0e33a1aeacf2fc518ad9273d6a1c2f (diff) |
[TCP]: remove tcp header from tcp_v4_check (take #2)
The tcphdr struct passed to tcp_v4_check is not used, the following
patch removes it from the parameter list.
This adds the netfilter modifications missing in the patch I sent
for rc3-mm1.
Signed-off-by: Frederik Deweerdt <frederik.deweerdt@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv4/netfilter/ip_nat_helper.c | 2 | ||||
-rw-r--r-- | net/ipv4/netfilter/ipt_REJECT.c | 2 | ||||
-rw-r--r-- | net/ipv4/netfilter/nf_nat_helper.c | 2 | ||||
-rw-r--r-- | net/ipv4/tcp_ipv4.c | 12 |
4 files changed, 9 insertions, 9 deletions
diff --git a/net/ipv4/netfilter/ip_nat_helper.c b/net/ipv4/netfilter/ip_nat_helper.c index ee80feb4b2a9..2e5c4bc52a60 100644 --- a/net/ipv4/netfilter/ip_nat_helper.c +++ b/net/ipv4/netfilter/ip_nat_helper.c | |||
@@ -183,7 +183,7 @@ ip_nat_mangle_tcp_packet(struct sk_buff **pskb, | |||
183 | datalen = (*pskb)->len - iph->ihl*4; | 183 | datalen = (*pskb)->len - iph->ihl*4; |
184 | if ((*pskb)->ip_summed != CHECKSUM_PARTIAL) { | 184 | if ((*pskb)->ip_summed != CHECKSUM_PARTIAL) { |
185 | tcph->check = 0; | 185 | tcph->check = 0; |
186 | tcph->check = tcp_v4_check(tcph, datalen, | 186 | tcph->check = tcp_v4_check(datalen, |
187 | iph->saddr, iph->daddr, | 187 | iph->saddr, iph->daddr, |
188 | csum_partial((char *)tcph, | 188 | csum_partial((char *)tcph, |
189 | datalen, 0)); | 189 | datalen, 0)); |
diff --git a/net/ipv4/netfilter/ipt_REJECT.c b/net/ipv4/netfilter/ipt_REJECT.c index f0319e5ee437..c9cad23844d7 100644 --- a/net/ipv4/netfilter/ipt_REJECT.c +++ b/net/ipv4/netfilter/ipt_REJECT.c | |||
@@ -116,7 +116,7 @@ static void send_reset(struct sk_buff *oldskb, int hook) | |||
116 | 116 | ||
117 | /* Adjust TCP checksum */ | 117 | /* Adjust TCP checksum */ |
118 | tcph->check = 0; | 118 | tcph->check = 0; |
119 | tcph->check = tcp_v4_check(tcph, sizeof(struct tcphdr), | 119 | tcph->check = tcp_v4_check(sizeof(struct tcphdr), |
120 | nskb->nh.iph->saddr, | 120 | nskb->nh.iph->saddr, |
121 | nskb->nh.iph->daddr, | 121 | nskb->nh.iph->daddr, |
122 | csum_partial((char *)tcph, | 122 | csum_partial((char *)tcph, |
diff --git a/net/ipv4/netfilter/nf_nat_helper.c b/net/ipv4/netfilter/nf_nat_helper.c index 98fbfc84d183..dc6738bdfab7 100644 --- a/net/ipv4/netfilter/nf_nat_helper.c +++ b/net/ipv4/netfilter/nf_nat_helper.c | |||
@@ -176,7 +176,7 @@ nf_nat_mangle_tcp_packet(struct sk_buff **pskb, | |||
176 | datalen = (*pskb)->len - iph->ihl*4; | 176 | datalen = (*pskb)->len - iph->ihl*4; |
177 | if ((*pskb)->ip_summed != CHECKSUM_PARTIAL) { | 177 | if ((*pskb)->ip_summed != CHECKSUM_PARTIAL) { |
178 | tcph->check = 0; | 178 | tcph->check = 0; |
179 | tcph->check = tcp_v4_check(tcph, datalen, | 179 | tcph->check = tcp_v4_check(datalen, |
180 | iph->saddr, iph->daddr, | 180 | iph->saddr, iph->daddr, |
181 | csum_partial((char *)tcph, | 181 | csum_partial((char *)tcph, |
182 | datalen, 0)); | 182 | datalen, 0)); |
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 12de90a5047c..f061ec50d8bc 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c | |||
@@ -502,11 +502,11 @@ void tcp_v4_send_check(struct sock *sk, int len, struct sk_buff *skb) | |||
502 | struct tcphdr *th = skb->h.th; | 502 | struct tcphdr *th = skb->h.th; |
503 | 503 | ||
504 | if (skb->ip_summed == CHECKSUM_PARTIAL) { | 504 | if (skb->ip_summed == CHECKSUM_PARTIAL) { |
505 | th->check = ~tcp_v4_check(th, len, | 505 | th->check = ~tcp_v4_check(len, inet->saddr, |
506 | inet->saddr, inet->daddr, 0); | 506 | inet->daddr, 0); |
507 | skb->csum_offset = offsetof(struct tcphdr, check); | 507 | skb->csum_offset = offsetof(struct tcphdr, check); |
508 | } else { | 508 | } else { |
509 | th->check = tcp_v4_check(th, len, inet->saddr, inet->daddr, | 509 | th->check = tcp_v4_check(len, inet->saddr, inet->daddr, |
510 | csum_partial((char *)th, | 510 | csum_partial((char *)th, |
511 | th->doff << 2, | 511 | th->doff << 2, |
512 | skb->csum)); | 512 | skb->csum)); |
@@ -525,7 +525,7 @@ int tcp_v4_gso_send_check(struct sk_buff *skb) | |||
525 | th = skb->h.th; | 525 | th = skb->h.th; |
526 | 526 | ||
527 | th->check = 0; | 527 | th->check = 0; |
528 | th->check = ~tcp_v4_check(th, skb->len, iph->saddr, iph->daddr, 0); | 528 | th->check = ~tcp_v4_check(skb->len, iph->saddr, iph->daddr, 0); |
529 | skb->csum_offset = offsetof(struct tcphdr, check); | 529 | skb->csum_offset = offsetof(struct tcphdr, check); |
530 | skb->ip_summed = CHECKSUM_PARTIAL; | 530 | skb->ip_summed = CHECKSUM_PARTIAL; |
531 | return 0; | 531 | return 0; |
@@ -747,7 +747,7 @@ static int tcp_v4_send_synack(struct sock *sk, struct request_sock *req, | |||
747 | if (skb) { | 747 | if (skb) { |
748 | struct tcphdr *th = skb->h.th; | 748 | struct tcphdr *th = skb->h.th; |
749 | 749 | ||
750 | th->check = tcp_v4_check(th, skb->len, | 750 | th->check = tcp_v4_check(skb->len, |
751 | ireq->loc_addr, | 751 | ireq->loc_addr, |
752 | ireq->rmt_addr, | 752 | ireq->rmt_addr, |
753 | csum_partial((char *)th, skb->len, | 753 | csum_partial((char *)th, skb->len, |
@@ -1514,7 +1514,7 @@ static struct sock *tcp_v4_hnd_req(struct sock *sk, struct sk_buff *skb) | |||
1514 | static __sum16 tcp_v4_checksum_init(struct sk_buff *skb) | 1514 | static __sum16 tcp_v4_checksum_init(struct sk_buff *skb) |
1515 | { | 1515 | { |
1516 | if (skb->ip_summed == CHECKSUM_COMPLETE) { | 1516 | if (skb->ip_summed == CHECKSUM_COMPLETE) { |
1517 | if (!tcp_v4_check(skb->h.th, skb->len, skb->nh.iph->saddr, | 1517 | if (!tcp_v4_check(skb->len, skb->nh.iph->saddr, |
1518 | skb->nh.iph->daddr, skb->csum)) { | 1518 | skb->nh.iph->daddr, skb->csum)) { |
1519 | skb->ip_summed = CHECKSUM_UNNECESSARY; | 1519 | skb->ip_summed = CHECKSUM_UNNECESSARY; |
1520 | return 0; | 1520 | return 0; |