diff options
Diffstat (limited to 'net/ipv4/tcp.c')
-rw-r--r-- | net/ipv4/tcp.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 0e029c4e2903..c04176be7ed1 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c | |||
@@ -2166,7 +2166,7 @@ struct sk_buff *tcp_tso_segment(struct sk_buff *skb, int sg) | |||
2166 | if (!pskb_may_pull(skb, thlen)) | 2166 | if (!pskb_may_pull(skb, thlen)) |
2167 | goto out; | 2167 | goto out; |
2168 | 2168 | ||
2169 | oldlen = ~htonl(skb->len); | 2169 | oldlen = (u16)~skb->len; |
2170 | __skb_pull(skb, thlen); | 2170 | __skb_pull(skb, thlen); |
2171 | 2171 | ||
2172 | segs = skb_segment(skb, sg); | 2172 | segs = skb_segment(skb, sg); |
@@ -2174,7 +2174,7 @@ struct sk_buff *tcp_tso_segment(struct sk_buff *skb, int sg) | |||
2174 | goto out; | 2174 | goto out; |
2175 | 2175 | ||
2176 | len = skb_shinfo(skb)->gso_size; | 2176 | len = skb_shinfo(skb)->gso_size; |
2177 | delta = csum_add(oldlen, htonl(thlen + len)); | 2177 | delta = htonl(oldlen + (thlen + len)); |
2178 | 2178 | ||
2179 | skb = segs; | 2179 | skb = segs; |
2180 | th = skb->h.th; | 2180 | th = skb->h.th; |
@@ -2183,10 +2183,10 @@ struct sk_buff *tcp_tso_segment(struct sk_buff *skb, int sg) | |||
2183 | do { | 2183 | do { |
2184 | th->fin = th->psh = 0; | 2184 | th->fin = th->psh = 0; |
2185 | 2185 | ||
2186 | if (skb->ip_summed == CHECKSUM_NONE) { | 2186 | th->check = ~csum_fold(th->check + delta); |
2187 | th->check = csum_fold(csum_partial( | 2187 | if (skb->ip_summed != CHECKSUM_HW) |
2188 | skb->h.raw, thlen, csum_add(skb->csum, delta))); | 2188 | th->check = csum_fold(csum_partial(skb->h.raw, thlen, |
2189 | } | 2189 | skb->csum)); |
2190 | 2190 | ||
2191 | seq += len; | 2191 | seq += len; |
2192 | skb = skb->next; | 2192 | skb = skb->next; |
@@ -2196,11 +2196,11 @@ struct sk_buff *tcp_tso_segment(struct sk_buff *skb, int sg) | |||
2196 | th->cwr = 0; | 2196 | th->cwr = 0; |
2197 | } while (skb->next); | 2197 | } while (skb->next); |
2198 | 2198 | ||
2199 | if (skb->ip_summed == CHECKSUM_NONE) { | 2199 | delta = htonl(oldlen + (skb->tail - skb->h.raw) + skb->data_len); |
2200 | delta = csum_add(oldlen, htonl(skb->tail - skb->h.raw)); | 2200 | th->check = ~csum_fold(th->check + delta); |
2201 | th->check = csum_fold(csum_partial( | 2201 | if (skb->ip_summed != CHECKSUM_HW) |
2202 | skb->h.raw, thlen, csum_add(skb->csum, delta))); | 2202 | th->check = csum_fold(csum_partial(skb->h.raw, thlen, |
2203 | } | 2203 | skb->csum)); |
2204 | 2204 | ||
2205 | out: | 2205 | out: |
2206 | return segs; | 2206 | return segs; |