Charles-Francois Natali <neolo...@free.fr> added the comment:

> but sometimes socket.close will send TCP RST to disconnect the telnet and 
> with wrong sequence number

This is called a a "half-duplex" TCP close sequence. Your application is 
probably closing the socket while there are still data in the receive socket 
buffer (i.e. unread), so the TCP/IP stack sends a RST to inform the remote end 
that data has been lost. See RFC 1122 section 4.2.2.13.
Note that in your sample capture, I don't see any invalid sequence/ack number.
Your application should probably not close the connection at this time.

> This kind of RST will be considering as Network RST attack, and this packet 
> will be dropped, the telnet connection will still established and cannot be 
> closed.

There you firewell is broken. Sending a RST in this context is perfectly valid.

As far as I know, this issue is due to your application and firewall settings, 
and not to Python. Furthermore, Python just calls the underlying close(2) 
syscall, so even if there were an issue, it's an OS one, nothing Python could 
do about it.

----------
nosy: +neologix

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue10724>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to