diff options
Diffstat (limited to 'net/ipv4/tcp_ipv4.c')
-rw-r--r-- | net/ipv4/tcp_ipv4.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index f3e52bc98980..2c6aec2643e8 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c | |||
@@ -561,16 +561,9 @@ void __tcp_v4_send_check(struct sk_buff *skb, __be32 saddr, __be32 daddr) | |||
561 | { | 561 | { |
562 | struct tcphdr *th = tcp_hdr(skb); | 562 | struct tcphdr *th = tcp_hdr(skb); |
563 | 563 | ||
564 | if (skb->ip_summed == CHECKSUM_PARTIAL) { | 564 | th->check = ~tcp_v4_check(skb->len, saddr, daddr, 0); |
565 | th->check = ~tcp_v4_check(skb->len, saddr, daddr, 0); | 565 | skb->csum_start = skb_transport_header(skb) - skb->head; |
566 | skb->csum_start = skb_transport_header(skb) - skb->head; | 566 | skb->csum_offset = offsetof(struct tcphdr, check); |
567 | skb->csum_offset = offsetof(struct tcphdr, check); | ||
568 | } else { | ||
569 | th->check = tcp_v4_check(skb->len, saddr, daddr, | ||
570 | csum_partial(th, | ||
571 | th->doff << 2, | ||
572 | skb->csum)); | ||
573 | } | ||
574 | } | 567 | } |
575 | 568 | ||
576 | /* This routine computes an IPv4 TCP checksum. */ | 569 | /* This routine computes an IPv4 TCP checksum. */ |