From patchwork Wed Jan 6 22:11:42 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Milan Plzik X-Patchwork-Id: 42340 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 3F91EB6EFE for ; Thu, 7 Jan 2010 09:12:41 +1100 (EST) Received: from localhost ([127.0.0.1]:39298 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NSe7I-0005Lk-R2 for incoming@patchwork.ozlabs.org; Wed, 06 Jan 2010 17:12:36 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NSe6n-0005Kf-96 for qemu-devel@nongnu.org; Wed, 06 Jan 2010 17:12:05 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NSe6h-0005GC-0X for qemu-devel@nongnu.org; Wed, 06 Jan 2010 17:12:04 -0500 Received: from [199.232.76.173] (port=59960 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NSe6g-0005G9-TX for qemu-devel@nongnu.org; Wed, 06 Jan 2010 17:11:58 -0500 Received: from mail-bw0-f212.google.com ([209.85.218.212]:33977) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NSe6g-0003i4-Eo for qemu-devel@nongnu.org; Wed, 06 Jan 2010 17:11:58 -0500 Received: by bwz4 with SMTP id 4so11207076bwz.2 for ; Wed, 06 Jan 2010 14:11:56 -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=aW8B3z/iYpnAohdgf0NaHw5QRE8wquWdf8AKRhXRf1k=; b=OGpxDu/Z++iH4G4ix+qxDmEfufdQiVb6EbrbZTtxsqgV5hGFx/bjIH/86WW4n+8B9Y n/VBsCw/ZumpAToBRIw+0HNFqeDn87p6OJYj1LhF668GXlzUeJ2kWe0bpVOPfwHsN/p4 oUMrtQxjtklqbekXSSVdpwoYtqD7/8f5qVH9o= 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=hEYjsEs9rXtx8jJPSbFCtCbVgh+tzr7CzQoh3KTyG6B4gPCsOvjbL3RfJtec6gVXx+ KHRVJqY5e674GCeqykLxf/x2HN+YXlpPR1oK2K74W1ysqF8EQQo3XR666k/6y2NiUZlq rjx1UI2Ydu+aMTx6fdmQsqOkqB1PGn9fwyOkE= Received: by 10.204.15.145 with SMTP id k17mr6692202bka.70.1262815916091; Wed, 06 Jan 2010 14:11:56 -0800 (PST) Received: from ?158.195.166.124? ([158.195.166.124]) by mx.google.com with ESMTPS id 13sm6838833bwz.10.2010.01.06.14.11.53 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 06 Jan 2010 14:11:54 -0800 (PST) From: Milan Plzik To: qemu-devel@nongnu.org Date: Wed, 06 Jan 2010 23:11:42 +0100 Message-ID: <1262815902.18404.341.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 Hello, 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. I would like to thank to mbc and th1 (who is the rightful author of the patch) from #gpxe for their time, effort and patience with me :) 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; } }