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

[TCP]: Handle passive resets correctly in SYN-RECV.

parent 11db4bd4
...@@ -902,13 +902,13 @@ struct sock *tcp_check_req(struct sock *sk,struct sk_buff *skb, ...@@ -902,13 +902,13 @@ struct sock *tcp_check_req(struct sock *sk,struct sk_buff *skb,
* and the incoming segment acknowledges something not yet * and the incoming segment acknowledges something not yet
* sent (the segment carries an unaccaptable ACK) ... * sent (the segment carries an unaccaptable ACK) ...
* a reset is sent." * a reset is sent."
*
* Invalid ACK: reset will be sent by listening socket
*/ */
if (!(flg & TCP_FLAG_ACK)) if ((flg & TCP_FLAG_ACK) &&
return NULL; (TCP_SKB_CB(skb)->ack_seq != req->snt_isn+1))
/* Invalid ACK: reset will be sent by listening socket */
if (TCP_SKB_CB(skb)->ack_seq != req->snt_isn+1)
return sk; return sk;
/* Also, it would be not so bad idea to check rcv_tsecr, which /* Also, it would be not so bad idea to check rcv_tsecr, which
* is essentially ACK extension and too early or too late values * is essentially ACK extension and too early or too late values
* should cause reset in unsynchronized states. * should cause reset in unsynchronized states.
......
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