aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/tcp_offload.c27
1 files changed, 3 insertions, 24 deletions
diff --git a/net/ipv4/tcp_offload.c b/net/ipv4/tcp_offload.c
index bc1b83cb8309..72912533a191 100644
--- a/net/ipv4/tcp_offload.c
+++ b/net/ipv4/tcp_offload.c
@@ -288,35 +288,14 @@ static int tcp_v4_gso_send_check(struct sk_buff *skb)
288 288
289static struct sk_buff **tcp4_gro_receive(struct sk_buff **head, struct sk_buff *skb) 289static struct sk_buff **tcp4_gro_receive(struct sk_buff **head, struct sk_buff *skb)
290{ 290{
291 /* Use the IP hdr immediately proceeding for this transport */
292 const struct iphdr *iph = skb_gro_network_header(skb);
293 __wsum wsum;
294
295 /* Don't bother verifying checksum if we're going to flush anyway. */ 291 /* Don't bother verifying checksum if we're going to flush anyway. */
296 if (NAPI_GRO_CB(skb)->flush) 292 if (!NAPI_GRO_CB(skb)->flush &&
297 goto skip_csum; 293 skb_gro_checksum_validate(skb, IPPROTO_TCP,
298 294 inet_gro_compute_pseudo)) {
299 wsum = NAPI_GRO_CB(skb)->csum;
300
301 switch (skb->ip_summed) {
302 case CHECKSUM_NONE:
303 wsum = skb_checksum(skb, skb_gro_offset(skb), skb_gro_len(skb),
304 0);
305
306 /* fall through */
307
308 case CHECKSUM_COMPLETE:
309 if (!tcp_v4_check(skb_gro_len(skb), iph->saddr, iph->daddr,
310 wsum)) {
311 skb->ip_summed = CHECKSUM_UNNECESSARY;
312 break;
313 }
314
315 NAPI_GRO_CB(skb)->flush = 1; 295 NAPI_GRO_CB(skb)->flush = 1;
316 return NULL; 296 return NULL;
317 } 297 }
318 298
319skip_csum:
320 return tcp_gro_receive(head, skb); 299 return tcp_gro_receive(head, skb);
321} 300}
322 301