Simon Glass
2011-Oct-24 23:48 UTC
[syslinux] [PATCH] tftpd: Fix wrap-around logic when receiving large files
Sending a large file (typically >90MB) to tftpd fails because it never
acks the packet after a rollover. This patch attempts to correct that.
I could not load the git repo, and cannot check kernel.org to see if
this is already fixed so this patch is against tftp-hpa_5.0-11ubuntu2.1.
Please ignore this patch if you have already fixed this. Also please cc
me on any reply since I do not get mailing list emails.
Thank you.
Signed-off-by: Simon Glass <sjg at chromium.org>
---
tftpd/tftpd.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/tftpd/tftpd.c b/tftpd/tftpd.c
index b3b49ee..52db5dd 100644
--- a/tftpd/tftpd.c
+++ b/tftpd/tftpd.c
@@ -1580,6 +1580,7 @@ static void tftp_recvfile(struct formats *pf, struct
tftphdr *oap, int oacklen)
static struct tftphdr *ap; /* ack buffer */
static u_short block = 0;
static int acksize;
+ static int first = 1;
u_short dp_opcode, dp_block;
unsigned long r_timeout;
@@ -1587,9 +1588,10 @@ static void tftp_recvfile(struct formats *pf, struct
tftphdr *oap, int oacklen)
do {
timeout = rexmtval;
- if (!block && oap) {
+ if (first && oap) {
ap = (struct tftphdr *)ackbuf;
acksize = oacklen;
+ first = 0;
} else {
ap = (struct tftphdr *)ackbuf;
ap->th_opcode = htons((u_short) ACK);
--
1.7.3.1
H. Peter Anvin
2011-Nov-07 19:05 UTC
[syslinux] [PATCH] tftpd: Fix wrap-around logic when receiving large files
On 10/24/2011 04:48 PM, Simon Glass wrote:> Sending a large file (typically >90MB) to tftpd fails because it never > acks the packet after a rollover. This patch attempts to correct that. > > I could not load the git repo, and cannot check kernel.org to see if > this is already fixed so this patch is against tftp-hpa_5.0-11ubuntu2.1. > > Please ignore this patch if you have already fixed this. Also please cc > me on any reply since I do not get mailing list emails. > > Thank you. > > Signed-off-by: Simon Glass <sjg at chromium.org>Does this match this fix (which was included in 5.1)? http://git.kernel.org/?p=network/tftp/tftp-hpa.git;a=commitdiff;h=aeb1c31bae431ad3b9269befa221229458adb854 -hpa
Simon Glass
2011-Nov-07 21:00 UTC
[syslinux] [PATCH] tftpd: Fix wrap-around logic when receiving large files
On Mon, Nov 7, 2011 at 11:05 AM, H. Peter Anvin <hpa at zytor.com> wrote:> On 10/24/2011 04:48 PM, Simon Glass wrote: >> Sending a large file (typically >90MB) to tftpd fails because it never >> acks the packet after a rollover. This patch attempts to correct that. >> >> I could not load the git repo, and cannot check kernel.org to see if >> this is already fixed so this patch is against tftp-hpa_5.0-11ubuntu2.1. >> >> Please ignore this patch if you have already fixed this. Also please cc >> me on any reply since I do not get mailing list emails. >> >> Thank you. >> >> Signed-off-by: Simon Glass <sjg at chromium.org> > > Does this match this fix (which was included in 5.1)? > > http://git.kernel.org/?p=network/tftp/tftp-hpa.git;a=commitdiff;h=aeb1c31bae431ad3b9269befa221229458adb854 > > ? ? ? ?-hpa >Yes that looks good, thank you. Please drop my patch. Regards, Simon