aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4
diff options
context:
space:
mode:
authorTom Herbert <therbert@google.com>2014-08-22 16:34:30 -0400
committerDavid S. Miller <davem@davemloft.net>2014-08-24 21:09:24 -0400
commit149d0774a729497c6a876260d3884826088724b6 (patch)
tree92321882340edcbbfce97bab3ae38574d583d692 /net/ipv4
parent758f75d1ffa9ef482ae095f40087cf217e1f41b0 (diff)
tcp: Call skb_gro_checksum_validate
In tcp[64]_gro_receive call skb_gro_checksum_validate to validate TCP checksum in the gro context. Signed-off-by: Tom Herbert <therbert@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
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