Commit a0faeab7 authored by Alexey Kuznetsov's avatar Alexey Kuznetsov Committed by David S. Miller

TCP Input fixes:

1) Two bugs noticed by Pasi:
   - Wrong rtt update interval
   - Forgot to clear retrans_stamp when entering established
     state
2) Missing LAST_ACK case of processing segment text (step 7) in
   tcp_rcv_state_process.
3) Remove "final cut" code, purism is good not all the times. :-)
parent f87c3f42
......@@ -124,9 +124,6 @@ static __inline__ void tcp_measure_rcv_mss(struct tcp_opt *tp, struct sk_buff *s
len = skb->len;
if (len >= tp->ack.rcv_mss) {
tp->ack.rcv_mss = len;
/* Dubious? Rather, it is final cut. 8) */
if (tcp_flag_word(skb->h.th)&TCP_REMNANT)
tp->ack.pending |= TCP_ACK_PUSHED;
} else {
/* Otherwise, we make more careful check taking into account,
* that SACKs block is variable.
......@@ -463,7 +460,7 @@ static __inline__ void tcp_rtt_estimator(struct tcp_opt *tp, __u32 mrtt)
if (after(tp->snd_una, tp->rtt_seq)) {
if (tp->mdev_max < tp->rttvar)
tp->rttvar -= (tp->rttvar-tp->mdev_max)>>2;
tp->rtt_seq = tp->snd_una;
tp->rtt_seq = tp->snd_nxt;
tp->mdev_max = TCP_RTO_MIN;
}
} else {
......@@ -1769,6 +1766,7 @@ static int tcp_clean_rtx_queue(struct sock *sk)
acked |= FLAG_DATA_ACKED;
} else {
acked |= FLAG_SYN_ACKED;
tp->retrans_stamp = 0;
}
if (sacked) {
......@@ -3873,6 +3871,7 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb,
switch (sk->state) {
case TCP_CLOSE_WAIT:
case TCP_CLOSING:
case TCP_LAST_ACK:
if (!before(TCP_SKB_CB(skb)->seq, tp->rcv_nxt))
break;
case TCP_FIN_WAIT1:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment