Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 134356
b: refs/heads/master
c: aa6320d
h: refs/heads/master
v: v3
  • Loading branch information
Herbert Xu authored and David S. Miller committed Feb 9, 2009
1 parent a9d8932 commit c223492
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 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: a5ad24be728d4352b71a81fba471aa41eb71f83a
refs/heads/master: aa6320d336971171df1d13c1c284facf10804881
15 changes: 8 additions & 7 deletions trunk/net/ipv4/tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -2478,9 +2478,9 @@ struct sk_buff **tcp_gro_receive(struct sk_buff **head, struct sk_buff *skb)
struct tcphdr *th2;
unsigned int thlen;
unsigned int flags;
unsigned int total;
unsigned int mss = 1;
int flush = 1;
int i;

th = skb_gro_header(skb, sizeof(*th));
if (unlikely(!th))
Expand All @@ -2504,7 +2504,7 @@ struct sk_buff **tcp_gro_receive(struct sk_buff **head, struct sk_buff *skb)

th2 = tcp_hdr(p);

if (th->source != th2->source || th->dest != th2->dest) {
if ((th->source ^ th2->source) | (th->dest ^ th2->dest)) {
NAPI_GRO_CB(p)->same_flow = 0;
continue;
}
Expand All @@ -2519,14 +2519,15 @@ struct sk_buff **tcp_gro_receive(struct sk_buff **head, struct sk_buff *skb)
flush |= flags & TCP_FLAG_CWR;
flush |= (flags ^ tcp_flag_word(th2)) &
~(TCP_FLAG_CWR | TCP_FLAG_FIN | TCP_FLAG_PSH);
flush |= th->ack_seq != th2->ack_seq || th->window != th2->window;
flush |= memcmp(th + 1, th2 + 1, thlen - sizeof(*th));
flush |= (th->ack_seq ^ th2->ack_seq) | (th->window ^ th2->window);
for (i = sizeof(*th); !flush && i < thlen; i += 4)
flush |= *(u32 *)((u8 *)th + i) ^
*(u32 *)((u8 *)th2 + i);

total = skb_gro_len(p);
mss = skb_shinfo(p)->gso_size;

flush |= skb_gro_len(skb) > mss || !skb_gro_len(skb);
flush |= ntohl(th2->seq) + total != ntohl(th->seq);
flush |= (skb_gro_len(skb) > mss) | !skb_gro_len(skb);
flush |= (ntohl(th2->seq) + skb_gro_len(p)) ^ ntohl(th->seq);

if (flush || skb_gro_receive(head, skb)) {
mss = 1;
Expand Down

0 comments on commit c223492

Please sign in to comment.