From patchwork Thu Jan 7 12:39:43 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Milan Plzik X-Patchwork-Id: 42429 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 04060B6ED0 for ; Thu, 7 Jan 2010 23:46:05 +1100 (EST) Received: from localhost ([127.0.0.1]:47811 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NSrkX-0003ex-SO for incoming@patchwork.ozlabs.org; Thu, 07 Jan 2010 07:46:01 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NSref-0001JB-In for qemu-devel@nongnu.org; Thu, 07 Jan 2010 07:39:57 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NSreb-0001FC-MN for qemu-devel@nongnu.org; Thu, 07 Jan 2010 07:39:57 -0500 Received: from [199.232.76.173] (port=57132 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NSreb-0001F1-HI for qemu-devel@nongnu.org; Thu, 07 Jan 2010 07:39:53 -0500 Received: from fg-out-1718.google.com ([72.14.220.157]:22727) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NSreb-0001HX-2J for qemu-devel@nongnu.org; Thu, 07 Jan 2010 07:39:53 -0500 Received: by fg-out-1718.google.com with SMTP id 19so2477740fgg.10 for ; Thu, 07 Jan 2010 04:39:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:from:to:content-type :date:message-id:mime-version:x-mailer; bh=g0ClN8pHNKIFgH2sK2eK3SY4AXrwPe4lSBcvX84JC7E=; b=oQMptKcVm0bTKmNQjjoFtEIVO/VdQrS9r/01DRhETV22buMD2fvFSiafzkZR9/H4xS +KkgZTKfr5kqlFc431ToeT5Nkon12/r6axUDhhYRcv8gD9MvPLTySzIVg/k7BQxrUdoe 6euupafsAegwksgNCIUl0nY7GvtM3nZfeE6lc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:content-type:date:message-id:mime-version:x-mailer; b=ox/8f4yNHwCYD2kYbieluI5UpETvqyjeFtPHcEbLWiCwdCrjPiOKuWiivGF1nD5eQF /R9G3PYll2RNNaHe1R3L8SgWujL4spdGs4OpgZ3BlaUEuuljby0fxyOqVvMZsCUPcP/q 1KkiMf1KNce+BnuVq89K5SpHjIre3zts3hf/g= Received: by 10.102.211.2 with SMTP id j2mr8481227mug.67.1262867991946; Thu, 07 Jan 2010 04:39:51 -0800 (PST) Received: from ?158.195.166.124? ([158.195.166.124]) by mx.google.com with ESMTPS id j10sm3610544muh.13.2010.01.07.04.39.50 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 07 Jan 2010 04:39:51 -0800 (PST) From: Milan Plzik To: qemu-devel@nongnu.org Date: Thu, 07 Jan 2010 13:39:43 +0100 Message-ID: <1262867983.18404.659.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.28.2 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: [Qemu-devel] Qemu's internal TFTP server breaks lock-step-iness of TFTP X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org According to RFC 1350 and RFC 2347, TFTP server should answer RRQ by either OACK or DATA packet. Qemu's internal TFTP server answers RRQ with additional options by sending both OACK and DATA packet, thus breaking the "lock-step" feature of the protocol, and also confuses client. Proposed solution would be to, in case of OACK packet, wait for ACK from client and just then start sending data. Attached patch implements this. Signed-off-by: Thomas Horsten Signed-off-by: Milan Plzik diff --git a/slirp/tftp.c b/slirp/tftp.c index 082f5d0..db869fc 100644 --- a/slirp/tftp.c +++ b/slirp/tftp.c @@ -362,6 +362,7 @@ static void tftp_handle_rrq(Slirp *slirp, struct tftp_t *tp, int pktlen) } tftp_send_oack(spt, "tsize", tsize, tp); + return; } }