From mboxrd@z Thu Jan 1 00:00:00 1970 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) From: Milan Plzik Content-Type: multipart/mixed; boundary="=-pMG9lwGMmA83ROUnnm5+" Date: Wed, 06 Jan 2010 23:11:42 +0100 Message-ID: <1262815902.18404.341.camel@localhost> Mime-Version: 1.0 Subject: [Qemu-devel] Qemu's internal TFTP server breaks lock-step-iness of TFTP List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org --=-pMG9lwGMmA83ROUnnm5+ Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit 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 --=-pMG9lwGMmA83ROUnnm5+ Content-Disposition: attachment; filename="qemu_tftp_handle_oack_correctly.patch" Content-Type: text/x-patch; name="qemu_tftp_handle_oack_correctly.patch"; charset="UTF-8" Content-Transfer-Encoding: 7bit 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; } } --=-pMG9lwGMmA83ROUnnm5+--