aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_input.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2012-11-10 18:32:51 -0500
committerDavid S. Miller <davem@davemloft.net>2012-11-10 18:32:51 -0500
commitd4185bbf62a5d8d777ee445db1581beb17882a07 (patch)
tree024b0badbd7c970b1983be6d8c345cc4a290cb31 /net/ipv4/tcp_input.c
parentc075b13098b399dc565b4d53f42047a8d40ed3ba (diff)
parenta375413311b39005ef281bfd71ae8f4e3df22e97 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts: drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c Minor conflict between the BCM_CNIC define removal in net-next and a bug fix added to net. Based upon a conflict resolution patch posted by Stephen Rothwell. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_input.c')
-rw-r--r--net/ipv4/tcp_input.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index e95b4e508afe..7839d51fb65b 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -4553,6 +4553,9 @@ int tcp_send_rcvq(struct sock *sk, struct msghdr *msg, size_t size)
4553 struct tcphdr *th; 4553 struct tcphdr *th;
4554 bool fragstolen; 4554 bool fragstolen;
4555 4555
4556 if (size == 0)
4557 return 0;
4558
4556 skb = alloc_skb(size + sizeof(*th), sk->sk_allocation); 4559 skb = alloc_skb(size + sizeof(*th), sk->sk_allocation);
4557 if (!skb) 4560 if (!skb)
4558 goto err; 4561 goto err;
@@ -5653,6 +5656,7 @@ static bool tcp_rcv_fastopen_synack(struct sock *sk, struct sk_buff *synack,
5653 tcp_rearm_rto(sk); 5656 tcp_rearm_rto(sk);
5654 return true; 5657 return true;
5655 } 5658 }
5659 tp->syn_data_acked = tp->syn_data;
5656 return false; 5660 return false;
5657} 5661}
5658 5662
@@ -5970,7 +5974,7 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb,
5970 5974
5971 req = tp->fastopen_rsk; 5975 req = tp->fastopen_rsk;
5972 if (req != NULL) { 5976 if (req != NULL) {
5973 BUG_ON(sk->sk_state != TCP_SYN_RECV && 5977 WARN_ON_ONCE(sk->sk_state != TCP_SYN_RECV &&
5974 sk->sk_state != TCP_FIN_WAIT1); 5978 sk->sk_state != TCP_FIN_WAIT1);
5975 5979
5976 if (tcp_check_req(sk, skb, req, NULL, true) == NULL) 5980 if (tcp_check_req(sk, skb, req, NULL, true) == NULL)
@@ -6059,7 +6063,15 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb,
6059 * ACK we have received, this would have acknowledged 6063 * ACK we have received, this would have acknowledged
6060 * our SYNACK so stop the SYNACK timer. 6064 * our SYNACK so stop the SYNACK timer.
6061 */ 6065 */
6062 if (acceptable && req != NULL) { 6066 if (req != NULL) {
6067 /* Return RST if ack_seq is invalid.
6068 * Note that RFC793 only says to generate a
6069 * DUPACK for it but for TCP Fast Open it seems
6070 * better to treat this case like TCP_SYN_RECV
6071 * above.
6072 */
6073 if (!acceptable)
6074 return 1;
6063 /* We no longer need the request sock. */ 6075 /* We no longer need the request sock. */
6064 reqsk_fastopen_remove(sk, req, false); 6076 reqsk_fastopen_remove(sk, req, false);
6065 tcp_rearm_rto(sk); 6077 tcp_rearm_rto(sk);