qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Qemu's internal TFTP server breaks lock-step-iness of TFTP
@ 2010-01-06 22:11 Milan Plzik
  2010-01-06 22:43 ` Anthony Liguori
  2010-01-07 15:42 ` H. Peter Anvin
  0 siblings, 2 replies; 6+ messages in thread
From: Milan Plzik @ 2010-01-06 22:11 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 595 bytes --]

  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

[-- Attachment #2: qemu_tftp_handle_oack_correctly.patch --]
[-- Type: text/x-patch, Size: 283 bytes --]

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;
       }
   }
 

^ permalink raw reply related	[flat|nested] 6+ messages in thread
* [Qemu-devel] Qemu's internal TFTP server breaks lock-step-iness of TFTP
@ 2010-01-07 12:39 Milan Plzik
  2010-01-13 23:26 ` Anthony Liguori
  0 siblings, 1 reply; 6+ messages in thread
From: Milan Plzik @ 2010-01-07 12:39 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 535 bytes --]

  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 <thomas@horsten.com>
Signed-off-by: Milan Plzik <milan.plzik@gmail.com>


[-- Attachment #2: qemu_tftp_handle_oack_correctly.patch --]
[-- Type: text/x-patch, Size: 283 bytes --]

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;
       }
   }
 

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-01-13 23:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-06 22:11 [Qemu-devel] Qemu's internal TFTP server breaks lock-step-iness of TFTP Milan Plzik
2010-01-06 22:43 ` Anthony Liguori
2010-01-07 12:51   ` Milan Plzik
2010-01-07 15:42 ` H. Peter Anvin
  -- strict thread matches above, loose matches on Subject: below --
2010-01-07 12:39 Milan Plzik
2010-01-13 23:26 ` Anthony Liguori

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).