Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 328405
b: refs/heads/master
c: 861b650
h: refs/heads/master
i:
  328403: 513edf0
v: v3
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Oct 1, 2012
1 parent a9cde1c commit 68a1ed9
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 64c6d08e6490fb18cea09bb03686c149946bd818
refs/heads/master: 861b650101eb0c627d171eb18de81dddb93d395e
19 changes: 16 additions & 3 deletions trunk/net/ipv4/tcp_ipv4.c
Original file line number Diff line number Diff line change
Expand Up @@ -2803,6 +2803,8 @@ void tcp4_proc_exit(void)
struct sk_buff **tcp4_gro_receive(struct sk_buff **head, struct sk_buff *skb)
{
const struct iphdr *iph = skb_gro_network_header(skb);
__wsum wsum;
__sum16 sum;

switch (skb->ip_summed) {
case CHECKSUM_COMPLETE:
Expand All @@ -2811,11 +2813,22 @@ struct sk_buff **tcp4_gro_receive(struct sk_buff **head, struct sk_buff *skb)
skb->ip_summed = CHECKSUM_UNNECESSARY;
break;
}

/* fall through */
case CHECKSUM_NONE:
flush:
NAPI_GRO_CB(skb)->flush = 1;
return NULL;

case CHECKSUM_NONE:
wsum = csum_tcpudp_nofold(iph->saddr, iph->daddr,
skb_gro_len(skb), IPPROTO_TCP, 0);
sum = csum_fold(skb_checksum(skb,
skb_gro_offset(skb),
skb_gro_len(skb),
wsum));
if (sum)
goto flush;

skb->ip_summed = CHECKSUM_UNNECESSARY;
break;
}

return tcp_gro_receive(head, skb);
Expand Down
20 changes: 17 additions & 3 deletions trunk/net/ipv6/tcp_ipv6.c
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,8 @@ static struct sk_buff **tcp6_gro_receive(struct sk_buff **head,
struct sk_buff *skb)
{
const struct ipv6hdr *iph = skb_gro_network_header(skb);
__wsum wsum;
__sum16 sum;

switch (skb->ip_summed) {
case CHECKSUM_COMPLETE:
Expand All @@ -771,11 +773,23 @@ static struct sk_buff **tcp6_gro_receive(struct sk_buff **head,
skb->ip_summed = CHECKSUM_UNNECESSARY;
break;
}

/* fall through */
case CHECKSUM_NONE:
flush:
NAPI_GRO_CB(skb)->flush = 1;
return NULL;

case CHECKSUM_NONE:
wsum = ~csum_unfold(csum_ipv6_magic(&iph->saddr, &iph->daddr,
skb_gro_len(skb),
IPPROTO_TCP, 0));
sum = csum_fold(skb_checksum(skb,
skb_gro_offset(skb),
skb_gro_len(skb),
wsum));
if (sum)
goto flush;

skb->ip_summed = CHECKSUM_UNNECESSARY;
break;
}

return tcp_gro_receive(head, skb);
Expand Down

0 comments on commit 68a1ed9

Please sign in to comment.