diff options
Diffstat (limited to 'net/ipv4/tcp.c')
-rw-r--r-- | net/ipv4/tcp.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 73266b79c19a..90b2f3c192ff 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c | |||
@@ -2478,9 +2478,9 @@ struct sk_buff **tcp_gro_receive(struct sk_buff **head, struct sk_buff *skb) | |||
2478 | struct tcphdr *th2; | 2478 | struct tcphdr *th2; |
2479 | unsigned int thlen; | 2479 | unsigned int thlen; |
2480 | unsigned int flags; | 2480 | unsigned int flags; |
2481 | unsigned int total; | ||
2482 | unsigned int mss = 1; | 2481 | unsigned int mss = 1; |
2483 | int flush = 1; | 2482 | int flush = 1; |
2483 | int i; | ||
2484 | 2484 | ||
2485 | th = skb_gro_header(skb, sizeof(*th)); | 2485 | th = skb_gro_header(skb, sizeof(*th)); |
2486 | if (unlikely(!th)) | 2486 | if (unlikely(!th)) |
@@ -2504,7 +2504,7 @@ struct sk_buff **tcp_gro_receive(struct sk_buff **head, struct sk_buff *skb) | |||
2504 | 2504 | ||
2505 | th2 = tcp_hdr(p); | 2505 | th2 = tcp_hdr(p); |
2506 | 2506 | ||
2507 | if (th->source != th2->source || th->dest != th2->dest) { | 2507 | if ((th->source ^ th2->source) | (th->dest ^ th2->dest)) { |
2508 | NAPI_GRO_CB(p)->same_flow = 0; | 2508 | NAPI_GRO_CB(p)->same_flow = 0; |
2509 | continue; | 2509 | continue; |
2510 | } | 2510 | } |
@@ -2519,14 +2519,15 @@ found: | |||
2519 | flush |= flags & TCP_FLAG_CWR; | 2519 | flush |= flags & TCP_FLAG_CWR; |
2520 | flush |= (flags ^ tcp_flag_word(th2)) & | 2520 | flush |= (flags ^ tcp_flag_word(th2)) & |
2521 | ~(TCP_FLAG_CWR | TCP_FLAG_FIN | TCP_FLAG_PSH); | 2521 | ~(TCP_FLAG_CWR | TCP_FLAG_FIN | TCP_FLAG_PSH); |
2522 | flush |= th->ack_seq != th2->ack_seq || th->window != th2->window; | 2522 | flush |= (th->ack_seq ^ th2->ack_seq) | (th->window ^ th2->window); |
2523 | flush |= memcmp(th + 1, th2 + 1, thlen - sizeof(*th)); | 2523 | for (i = sizeof(*th); !flush && i < thlen; i += 4) |
2524 | flush |= *(u32 *)((u8 *)th + i) ^ | ||
2525 | *(u32 *)((u8 *)th2 + i); | ||
2524 | 2526 | ||
2525 | total = skb_gro_len(p); | ||
2526 | mss = skb_shinfo(p)->gso_size; | 2527 | mss = skb_shinfo(p)->gso_size; |
2527 | 2528 | ||
2528 | flush |= skb_gro_len(skb) > mss || !skb_gro_len(skb); | 2529 | flush |= (skb_gro_len(skb) > mss) | !skb_gro_len(skb); |
2529 | flush |= ntohl(th2->seq) + total != ntohl(th->seq); | 2530 | flush |= (ntohl(th2->seq) + skb_gro_len(p)) ^ ntohl(th->seq); |
2530 | 2531 | ||
2531 | if (flush || skb_gro_receive(head, skb)) { | 2532 | if (flush || skb_gro_receive(head, skb)) { |
2532 | mss = 1; | 2533 | mss = 1; |