From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NMYD1-0001FR-MM for qemu-devel@nongnu.org; Sun, 20 Dec 2009 21:41:19 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NMYCx-0001Bz-59 for qemu-devel@nongnu.org; Sun, 20 Dec 2009 21:41:19 -0500 Received: from [199.232.76.173] (port=58113 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NMYCx-0001Bo-0n for qemu-devel@nongnu.org; Sun, 20 Dec 2009 21:41:15 -0500 Received: from mail-pz0-f188.google.com ([209.85.222.188]:57648) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NMYCw-0006G7-2P for qemu-devel@nongnu.org; Sun, 20 Dec 2009 21:41:14 -0500 Received: by pzk26 with SMTP id 26so2794772pzk.4 for ; Sun, 20 Dec 2009 18:41:12 -0800 (PST) MIME-Version: 1.0 Date: Mon, 21 Dec 2009 10:41:12 +0800 Message-ID: From: Sam Liao Content-Type: text/plain; charset=ISO-8859-1 Subject: [Qemu-devel] [slirp] guest program's tcp connection hang on close_wait. List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Hi All, I am using qemu-arm running linux (guest), I start a server program on the linux(guest); then I start a program on host machine to connect to the server(on qemu linux guest) to a specified tcp port. (the qemu is started with tcp redir configuration). Then I got a problem when the client program on host closed the tcp connection when the server is busy sending data to client. The server program will hang on close_wait state. I captured the tcp packets between the host <-> qemu and qemu<->guest linux. It seems like the connection is closed like: 1. host <-> qemu FIN --> <-- ACK <-- More data with PUSH RST --> 2. qemu <-> guest FIN --> <-- ACK <-- More data ACK --> <-- More data ACK --> ... ACK, zero window-> <- Keep-Alive ACK, zero window-> <- keep alive So, here the connection between the qemu and guest did not closed correctly. After the qemu's FIN is acked by guest os, the qemu still receives data until it's window came to be zero(which I think maybe the receive buf is filled), then it came to a zerowindow-keepalive loop, and the connection is hanging there. I checked the slirp's source code, from the packet between host and qemu, the host connection is reset, and the problem is the connection between qemu and guest is not correctly closed by slirp. I'm not sure this is a slirp bug or something else, any suggestion would be appreciated. Thanks. -Sam