netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Simon Arlott <simon@fire.lp0.eu>
To: john@screen.lv
Cc: johnpol@2ka.mipt.ru, netdev@vger.kernel.org
Subject: Re: strange tcp behavior
Date: Thu, 02 Aug 2007 18:15:52 +0100	[thread overview]
Message-ID: <46B21148.2090004@simon.arlott.org.uk> (raw)
In-Reply-To: <48738.simon.1186056932@5ec7c279.invalid>

On 02/08/07 13:15, Simon Arlott wrote:
> (Don't remove CC:s, don't top post)
>>> On Thu, August 2, 2007 11:16, Evgeniy Polyakov wrote:
>>>> On Thu, Aug 02, 2007 at 01:55:50PM +0400, Evgeniy Polyakov
>>>> (johnpol@2ka.mipt.ru) wrote:
>>>>> On Thu, Aug 02, 2007 at 09:19:06AM +0300, john@screen.lv
>>>>> (john@screen.lv) wrote:
>>>>> > 1186035057.207629    127.0.0.1 -> 127.0.0.1    TCP 50000 > smtp [SYN]
>>>>> > Seq=0 Len=0
>>>>> > 1186035057.207632    127.0.0.1 -> 127.0.0.1    TCP smtp > 50000 [SYN,
>>>>> ACK]
>>>>> > Seq=0 Ack=1 Win=32792 Len=0 MSS=16396
>>>>> > 1186035057.207666    127.0.0.1 -> 127.0.0.1    TCP 50000 > smtp [ACK]
>>>>> > Seq=1 Ack=1 Win=1500 Len=0
>>>>> > 1186035057.207699    127.0.0.1 -> 127.0.0.1    SMTP Command: EHLO
>>>>> localhost
>>>>> > 1186035057.207718    127.0.0.1 -> 127.0.0.1    TCP smtp > 50000 [ACK]
>>>>> > Seq=1 Ack=17 Win=32792 Len=0
>>>>> > 1186035057.207736    127.0.0.1 -> 127.0.0.1    TCP 50000 > smtp [RST]
>>>>> > Seq=17 Len=0
>>>>> > 1186035057.223934    127.0.0.1 -> 127.0.0.1    TCP 33787 > 50000
>>>>> [RST,
>>>>> > ACK] Seq=0 Ack=0 Win=32792 Len=0
>>>>> >
>>>>> > Can someone please comment as to why, tcp  stack sends rst packet
>>>>> from the
>>>>> > wrong source port in this situation.

> I don't know where that extra RST is coming from.
> This test would be more convincing between two hosts, since your bizarre
> client is using raw sockets as root and could be doing anything.

Server 192.168.7.8 (2.6.23)
Client 192.168.7.4 (2.6.20)

17:33:45.326246 IP 192.168.7.4.50000 > 192.168.7.8.2500: S 1385353579:1385353579(0) win 1500
17:33:45.326418 IP 192.168.7.8.2500 > 192.168.7.4.50000: S 1388203102:1388203102(0) ack 1385353580 win 14360 <mss 7180>
17:33:45.348833 IP 192.168.7.4.50000 > 192.168.7.8.2500: . ack 1 win 1500
17:33:45.349977 IP 192.168.7.4.50000 > 192.168.7.8.2500: P 1:17(16) ack 1 win 1500
17:33:45.350117 IP 192.168.7.8.2500 > 192.168.7.4.50000: . ack 17 win 14360
17:33:45.351273 IP 192.168.7.4.50000 > 192.168.7.8.2500: R 1385353596:1385353596(0) win 1500
17:33:45.360878 IP 192.168.7.8.48186 > 192.168.7.4.50000: R 1388203103:1388203103(0) ack 1385353596 win 14360

Seems to be losing the source port information when it decides to send 
that final RST|ACK. It's going through the "TCPAbortOnClose" path:

tcp_close:
	-> tcp_set_state(sk, TCP_CLOSE)
		-> inet_put_port(&tcp_hashinfo, sk)
		Perhaps it's losing the port information here?
	-> tcp_send_active_reset(sk, GFP_KERNEL)

"TCP_CLOSE       socket is finished"
Should these two calls be the other way round?


Also, I don't think it should be sending a RST after the other side has 
sent one - the connection no longer exists so there is nothing on the 
other side to reset.

-- 
Simon Arlott

  reply	other threads:[~2007-08-02 17:16 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-02  6:19 strange tcp behavior john
2007-08-02  9:55 ` Evgeniy Polyakov
2007-08-02 10:16   ` Evgeniy Polyakov
2007-08-02 11:38     ` Simon Arlott
2007-08-02 12:04       ` Evgeniy Polyakov
2007-08-02 12:28         ` Evgeniy Polyakov
     [not found]       ` <46860.212.93.96.73.1186055105.squirrel@mail.screen.lv>
2007-08-02 12:15         ` Simon Arlott
2007-08-02 17:15           ` Simon Arlott [this message]
2007-08-02 18:08             ` Evgeniy Polyakov
2007-08-02 18:48               ` Evgeniy Polyakov
2007-08-02 22:02                 ` David Miller
2007-08-03  2:21                 ` David Miller
2007-08-03  8:22                   ` Evgeniy Polyakov
2007-08-03 20:04                     ` David Miller
2007-08-04 16:49                       ` Evgeniy Polyakov
2007-08-03 21:17                     ` David Miller
2007-08-04 16:51                       ` Evgeniy Polyakov
2007-08-05  3:21                         ` David Miller
2007-08-02 18:58               ` Simon Arlott
2007-08-03  8:25                 ` Evgeniy Polyakov
2007-08-03 11:21                   ` Simon Arlott
2007-08-03 11:56                     ` Evgeniy Polyakov
2007-08-03 12:03                       ` Simon Arlott
2007-08-03 12:09                         ` Evgeniy Polyakov
2007-08-03 16:51                           ` Simon Arlott
2007-08-03 17:39                             ` Evgeniy Polyakov
2007-08-03 18:29                               ` Simon Arlott
2007-08-04 16:03                                 ` Evgeniy Polyakov

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=46B21148.2090004@simon.arlott.org.uk \
    --to=simon@fire.lp0.eu \
    --cc=john@screen.lv \
    --cc=johnpol@2ka.mipt.ru \
    --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;
as well as URLs for NNTP newsgroup(s).