Netdev List
 help / color / mirror / Atom feed
From: zrpeng <zrpeng@linx-info.com>
To: netdev@vger.kernel.org
Subject: Why network stack not reply RST
Date: Tue, 27 Dec 2011 16:31:36 +0800	[thread overview]
Message-ID: <201112271631.36154.zrpeng@linx-info.com> (raw)

Hi:
    Why network stack not reply RST?
    I am doing test recently based on kernel 2.6.32. In my case:
    1) The server application closed the established socket, the network stack 
sent FIN to client. The socket status in kernel's network stack was 
TCP_FIN_WAIT1.
    2) The client sent out a tcp packet with ACK bit set for the server's FIN, 
the packet also took new data.
    3) When the server received the packet, network stack entered "step 5" in 
function "tcp_rcv_state_process".
    4) Then came to 'case TCP_FIN_WAIT1:'
    5) Then came to judgement
if (tp->linger2 < 0 ||
					    (TCP_SKB_CB(skb)->end_seq != TCP_SKB_CB(skb)->seq &&
					     after(TCP_SKB_CB(skb)->end_seq - th->fin, tp->rcv_nxt))) {
.....
}
    6) Because the previous packet took data and ACK (for the FIN), it entered 
the judgement. So, the socket is deleted in function 'tcp_done(sk)'.
    7) No TCP message was sent back to client side from then on, and client 
was left in LAST_ACK status.

    My questions are:
    1) Is this process correct? I think the server should sent RST to client, 
is this correct?
    2) What's the using of judgement 
 (TCP_SKB_CB(skb)->end_seq != TCP_SKB_CB(skb)->seq &&
					     after(TCP_SKB_CB(skb)->end_seq - th->fin, tp->rcv_nxt)

       The code exists from kernel 2.3.41 and 2.3.42. 

    Thank you very much!
    Best Regards.

    Peng Zhaoran from Linx-Info Tech.
    
    www.linx-info.com

             reply	other threads:[~2011-12-27  8:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-27  8:31 zrpeng [this message]
2011-12-29  3:04 ` Why network stack not reply RST Zhen-Hua Li
2011-12-29  3:17   ` zrpeng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201112271631.36154.zrpeng@linx-info.com \
    --to=zrpeng@linx-info.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox