Skip to contentSkip to conversation

Qemu's internal TFTP server breaks lock-step-iness of TFTP

Qemu-devel Applied Milan Plzik 2 participants 2 messages Jan 7, 2010 – Jan 13, 2010

lore
Share & tools
lore
#0 lore raw

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.

slirp/tftp.c +1 -0
index 082f5d0..db869fc 100644
@@ -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;
       }
   }
 
#1 lore raw
Quoted 5 lines · Milan Plzik

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.

Applied. Thanks.

Regards,

Anthony Liguori