diff options
Diffstat (limited to 'net/ipv4/tcp_input.c')
| -rw-r--r-- | net/ipv4/tcp_input.c | 9 | 
1 files changed, 5 insertions, 4 deletions
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index eb7f82ebf4a3..da782e7ab16d 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c @@ -817,7 +817,7 @@ __u32 tcp_init_cwnd(struct tcp_sock *tp, struct dst_entry *dst)  	__u32 cwnd = (dst ? dst_metric(dst, RTAX_INITCWND) : 0);  	if (!cwnd) -		cwnd = rfc3390_bytes_to_packets(tp->mss_cache); +		cwnd = TCP_INIT_CWND;  	return min_t(__u32, cwnd, tp->snd_cwnd_clamp);  } @@ -1222,7 +1222,7 @@ static int tcp_check_dsack(struct sock *sk, struct sk_buff *ack_skb,  	}  	/* D-SACK for already forgotten data... Do dumb counting. */ -	if (dup_sack && +	if (dup_sack && tp->undo_marker && tp->undo_retrans &&  	    !after(end_seq_0, prior_snd_una) &&  	    after(end_seq_0, tp->undo_marker))  		tp->undo_retrans--; @@ -1299,7 +1299,8 @@ static u8 tcp_sacktag_one(struct sk_buff *skb, struct sock *sk,  	/* Account D-SACK for retransmitted packet. */  	if (dup_sack && (sacked & TCPCB_RETRANS)) { -		if (after(TCP_SKB_CB(skb)->end_seq, tp->undo_marker)) +		if (tp->undo_marker && tp->undo_retrans && +		    after(TCP_SKB_CB(skb)->end_seq, tp->undo_marker))  			tp->undo_retrans--;  		if (sacked & TCPCB_SACKED_ACKED)  			state->reord = min(fack_count, state->reord); @@ -3349,7 +3350,7 @@ static int tcp_clean_rtx_queue(struct sock *sk, int prior_fackets,  						 net_invalid_timestamp()))  					rtt_us = ktime_us_delta(ktime_get_real(),  								last_ackt); -				else if (ca_seq_rtt > 0) +				else if (ca_seq_rtt >= 0)  					rtt_us = jiffies_to_usecs(ca_seq_rtt);  			}  | 
