diff options
-rw-r--r-- | net/ipv4/tcp_input.c | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 2711ef7df7b5..29999ef73b43 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c | |||
@@ -1474,17 +1474,15 @@ static void tcp_enter_frto_loss(struct sock *sk, int allowed_segments, int flag) | |||
1474 | { | 1474 | { |
1475 | struct tcp_sock *tp = tcp_sk(sk); | 1475 | struct tcp_sock *tp = tcp_sk(sk); |
1476 | struct sk_buff *skb; | 1476 | struct sk_buff *skb; |
1477 | int cnt = 0; | ||
1478 | 1477 | ||
1479 | tp->sacked_out = 0; | ||
1480 | tp->lost_out = 0; | 1478 | tp->lost_out = 0; |
1481 | tp->fackets_out = 0; | ||
1482 | tp->retrans_out = 0; | 1479 | tp->retrans_out = 0; |
1480 | if (IsReno(tp)) | ||
1481 | tcp_reset_reno_sack(tp); | ||
1483 | 1482 | ||
1484 | tcp_for_write_queue(skb, sk) { | 1483 | tcp_for_write_queue(skb, sk) { |
1485 | if (skb == tcp_send_head(sk)) | 1484 | if (skb == tcp_send_head(sk)) |
1486 | break; | 1485 | break; |
1487 | cnt += tcp_skb_pcount(skb); | ||
1488 | /* | 1486 | /* |
1489 | * Count the retransmission made on RTO correctly (only when | 1487 | * Count the retransmission made on RTO correctly (only when |
1490 | * waiting for the first ACK and did not get it)... | 1488 | * waiting for the first ACK and did not get it)... |
@@ -1498,19 +1496,12 @@ static void tcp_enter_frto_loss(struct sock *sk, int allowed_segments, int flag) | |||
1498 | } else { | 1496 | } else { |
1499 | TCP_SKB_CB(skb)->sacked &= ~(TCPCB_LOST|TCPCB_SACKED_RETRANS); | 1497 | TCP_SKB_CB(skb)->sacked &= ~(TCPCB_LOST|TCPCB_SACKED_RETRANS); |
1500 | } | 1498 | } |
1501 | if (!(TCP_SKB_CB(skb)->sacked&TCPCB_SACKED_ACKED)) { | ||
1502 | 1499 | ||
1503 | /* Do not mark those segments lost that were | 1500 | /* Don't lost mark skbs that were fwd transmitted after RTO */ |
1504 | * forward transmitted after RTO | 1501 | if (!(TCP_SKB_CB(skb)->sacked&TCPCB_SACKED_ACKED) && |
1505 | */ | 1502 | !after(TCP_SKB_CB(skb)->end_seq, tp->frto_highmark)) { |
1506 | if (!after(TCP_SKB_CB(skb)->end_seq, | 1503 | TCP_SKB_CB(skb)->sacked |= TCPCB_LOST; |
1507 | tp->frto_highmark)) { | 1504 | tp->lost_out += tcp_skb_pcount(skb); |
1508 | TCP_SKB_CB(skb)->sacked |= TCPCB_LOST; | ||
1509 | tp->lost_out += tcp_skb_pcount(skb); | ||
1510 | } | ||
1511 | } else { | ||
1512 | tp->sacked_out += tcp_skb_pcount(skb); | ||
1513 | tp->fackets_out = cnt; | ||
1514 | } | 1505 | } |
1515 | } | 1506 | } |
1516 | tcp_sync_left_out(tp); | 1507 | tcp_sync_left_out(tp); |