Qemu's internal TFTP server breaks lock-step-iness of TFTP
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
slirp/tftp.c +1 -0
@@ -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 ; } }
Quoted 7 lines · Milan Plzik
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.
Quoted 7 lines
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 :)
Thanks for the patch, I assume this fixes -boot n when using -bootp and -tftp. Can you add an appropriate Signed-off-by and resubmit?
Regards,
Anthony Liguori
Quoted 2 lines
Milan Plzik
V Streda, 6. január 2010 o 16:43 -0600, Anthony Liguori napísal(a):
Quoted 2 lines
Thanks for the patch, I assume this fixes -boot n when using -bootp and -tftp.
Not sure what was the original issue, but at least for me it fixed
booting pxegrub :)
Quoted 1 line
Can you add an appropriate Signed-off-by and resubmit?
Added, re-submitted; I hope it will be acceptable as an attachment.
Quoted 8 lines
Regards,
Anthony Liguori
Quoted 2 lines
Milan Plzik
Quoted 7 lines · Milan Plzik
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.
Quoted 8 lines
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
The built-in TFTP server has at least two *serious* other problems:
a) It has the Sorcerer's Apprentice bug (See RFC 1123 and 1350).
b) It doesn't do time-based retransmits.
Note that (a) can't be fixed without fixing (b).
-hpa
Signature · 2 lines
H. Peter Anvin, Intel Open Source Technology Center I work for Intel. I don't speak on their behalf.