Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 122127
b: refs/heads/master
c: adb92db
h: refs/heads/master
i:
  122125: 7a66991
  122123: 08438bc
  122119: 923ac48
  122111: 5ca8caf
v: v3
  • Loading branch information
Ilpo Järvinen authored and David S. Miller committed Nov 25, 2008
1 parent b45118c commit 6390ae4
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 5 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: e8bae275d9354104f7ae24a48a90d1a6286e7bd9
refs/heads/master: adb92db857ee2a0a2b925ccfbd560203c3f88aae
27 changes: 23 additions & 4 deletions trunk/net/ipv4/tcp_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -1248,20 +1248,39 @@ static int tcp_match_skb_to_sack(struct sock *sk, struct sk_buff *skb,
{
int in_sack, err;
unsigned int pkt_len;
unsigned int mss;

in_sack = !after(start_seq, TCP_SKB_CB(skb)->seq) &&
!before(end_seq, TCP_SKB_CB(skb)->end_seq);

if (tcp_skb_pcount(skb) > 1 && !in_sack &&
after(TCP_SKB_CB(skb)->end_seq, start_seq)) {

mss = tcp_skb_mss(skb);
in_sack = !after(start_seq, TCP_SKB_CB(skb)->seq);

if (!in_sack)
if (!in_sack) {
pkt_len = start_seq - TCP_SKB_CB(skb)->seq;
else
if (pkt_len < mss)
pkt_len = mss;
} else {
pkt_len = end_seq - TCP_SKB_CB(skb)->seq;
err = tcp_fragment(sk, skb, pkt_len, skb_shinfo(skb)->gso_size);
if (pkt_len < mss)
return -EINVAL;
}

/* Round if necessary so that SACKs cover only full MSSes
* and/or the remaining small portion (if present)
*/
if (pkt_len > mss) {
unsigned int new_len = (pkt_len / mss) * mss;
if (!in_sack && new_len < pkt_len) {
new_len += mss;
if (new_len > skb->len)
return 0;
}
pkt_len = new_len;
}
err = tcp_fragment(sk, skb, pkt_len, mss);
if (err < 0)
return err;
}
Expand Down

0 comments on commit 6390ae4

Please sign in to comment.