Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 287684
b: refs/heads/master
c: daef52b
h: refs/heads/master
v: v3
  • Loading branch information
Neal Cardwell authored and David S. Miller committed Feb 13, 2012
1 parent 1878627 commit 3612a1f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 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: cc9a672ee522d4805495b98680f4a3db5d0a0af9
refs/heads/master: daef52bab1fd26e24e8e9578f8fb33ba1d0cb412
19 changes: 10 additions & 9 deletions trunk/net/ipv4/tcp_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -1388,19 +1388,21 @@ static u8 tcp_sacktag_one(struct sock *sk,
return sacked;
}

/* Shift newly-SACKed bytes from this skb to the immediately previous
* already-SACKed sk_buff. Mark the newly-SACKed bytes as such.
*/
static int tcp_shifted_skb(struct sock *sk, struct sk_buff *skb,
struct tcp_sacktag_state *state,
unsigned int pcount, int shifted, int mss,
int dup_sack)
{
struct tcp_sock *tp = tcp_sk(sk);
struct sk_buff *prev = tcp_write_queue_prev(sk, skb);
u32 start_seq = TCP_SKB_CB(skb)->seq; /* start of newly-SACKed */
u32 end_seq = start_seq + shifted; /* end of newly-SACKed */

BUG_ON(!pcount);

if (skb == tp->lost_skb_hint)
tp->lost_cnt_hint += pcount;

TCP_SKB_CB(prev)->end_seq += shifted;
TCP_SKB_CB(skb)->seq += shifted;

Expand All @@ -1424,12 +1426,11 @@ static int tcp_shifted_skb(struct sock *sk, struct sk_buff *skb,
skb_shinfo(skb)->gso_type = 0;
}

/* We discard results */
tcp_sacktag_one(sk, state,
TCP_SKB_CB(skb)->sacked,
TCP_SKB_CB(skb)->seq,
TCP_SKB_CB(skb)->end_seq,
dup_sack, pcount);
/* Adjust counters and hints for the newly sacked sequence range but
* discard the return value since prev is already marked.
*/
tcp_sacktag_one(sk, state, TCP_SKB_CB(skb)->sacked,
start_seq, end_seq, dup_sack, pcount);

/* Difference in this won't matter, both ACKed by the same cumul. ACK */
TCP_SKB_CB(prev)->sacked |= (TCP_SKB_CB(skb)->sacked & TCPCB_EVER_RETRANS);
Expand Down

0 comments on commit 3612a1f

Please sign in to comment.