diff options
| author | Ingo Molnar <mingo@kernel.org> | 2012-12-07 12:15:33 +0100 | 
|---|---|---|
| committer | Ingo Molnar <mingo@kernel.org> | 2012-12-07 12:15:33 +0100 | 
| commit | 222e82bef4bd520a31d48c31ab24e49dd46daa46 (patch) | |
| tree | b6e73cad8e0b3a1c3e1acc537789e97aadaefa92 /net/ipv4/tcp_input.c | |
| parent | 38ca9c927c7d3db61f57e3d3a9334958c3af6e9a (diff) | |
| parent | 18a2f371f5edf41810f6469cb9be39931ef9deb9 (diff) | |
Merge branch 'linus' into sched/core
Pick up the autogroups fix and other fixes.
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'net/ipv4/tcp_input.c')
| -rw-r--r-- | net/ipv4/tcp_input.c | 31 | 
1 files changed, 24 insertions, 7 deletions
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 432c36649db3..609ff98aeb47 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c @@ -4529,6 +4529,9 @@ int tcp_send_rcvq(struct sock *sk, struct msghdr *msg, size_t size)  	struct tcphdr *th;  	bool fragstolen; +	if (size == 0) +		return 0; +  	skb = alloc_skb(size + sizeof(*th), sk->sk_allocation);  	if (!skb)  		goto err; @@ -5310,11 +5313,6 @@ static bool tcp_validate_incoming(struct sock *sk, struct sk_buff *skb,  		goto discard;  	} -	/* ts_recent update must be made after we are sure that the packet -	 * is in window. -	 */ -	tcp_replace_ts_recent(tp, TCP_SKB_CB(skb)->seq); -  	/* step 3: check security and precedence [ignored] */  	/* step 4: Check for a SYN @@ -5549,6 +5547,11 @@ step5:  	if (th->ack && tcp_ack(sk, skb, FLAG_SLOWPATH) < 0)  		goto discard; +	/* ts_recent update must be made after we are sure that the packet +	 * is in window. +	 */ +	tcp_replace_ts_recent(tp, TCP_SKB_CB(skb)->seq); +  	tcp_rcv_rtt_measure_ts(sk, skb);  	/* Process urgent data. */ @@ -5646,6 +5649,7 @@ static bool tcp_rcv_fastopen_synack(struct sock *sk, struct sk_buff *synack,  		tcp_rearm_rto(sk);  		return true;  	} +	tp->syn_data_acked = tp->syn_data;  	return false;  } @@ -5963,7 +5967,7 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb,  	req = tp->fastopen_rsk;  	if (req != NULL) { -		BUG_ON(sk->sk_state != TCP_SYN_RECV && +		WARN_ON_ONCE(sk->sk_state != TCP_SYN_RECV &&  		    sk->sk_state != TCP_FIN_WAIT1);  		if (tcp_check_req(sk, skb, req, NULL, true) == NULL) @@ -6052,7 +6056,15 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb,  			 * ACK we have received, this would have acknowledged  			 * our SYNACK so stop the SYNACK timer.  			 */ -			if (acceptable && req != NULL) { +			if (req != NULL) { +				/* Return RST if ack_seq is invalid. +				 * Note that RFC793 only says to generate a +				 * DUPACK for it but for TCP Fast Open it seems +				 * better to treat this case like TCP_SYN_RECV +				 * above. +				 */ +				if (!acceptable) +					return 1;  				/* We no longer need the request sock. */  				reqsk_fastopen_remove(sk, req, false);  				tcp_rearm_rto(sk); @@ -6118,6 +6130,11 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb,  	} else  		goto discard; +	/* ts_recent update must be made after we are sure that the packet +	 * is in window. +	 */ +	tcp_replace_ts_recent(tp, TCP_SKB_CB(skb)->seq); +  	/* step 6: check the URG bit */  	tcp_urg(sk, skb, th);  | 
