diff options
author | John Klug <john.klug@multitech.com> | 2020-11-11 16:17:52 -0600 |
---|---|---|
committer | John Klug <john.klug@multitech.com> | 2020-11-11 16:17:52 -0600 |
commit | 4bb6f26b05450777d14aa96e10783066c2503dc2 (patch) | |
tree | 3ed6c4bb86736d28926fd37a3c2b4eb81de44c82 /recipes-bsp/u-boot/u-boot-2016.09.01/tftpput.patch | |
download | meta-multitech-atmel-4bb6f26b05450777d14aa96e10783066c2503dc2.tar.gz meta-multitech-atmel-4bb6f26b05450777d14aa96e10783066c2503dc2.tar.bz2 meta-multitech-atmel-4bb6f26b05450777d14aa96e10783066c2503dc2.zip |
Diffstat (limited to 'recipes-bsp/u-boot/u-boot-2016.09.01/tftpput.patch')
-rw-r--r-- | recipes-bsp/u-boot/u-boot-2016.09.01/tftpput.patch | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/recipes-bsp/u-boot/u-boot-2016.09.01/tftpput.patch b/recipes-bsp/u-boot/u-boot-2016.09.01/tftpput.patch new file mode 100644 index 0000000..b5e419f --- /dev/null +++ b/recipes-bsp/u-boot/u-boot-2016.09.01/tftpput.patch @@ -0,0 +1,28 @@ +/* + * tftpput in u-boot has two issues. It never resets the timeout, so + * tftpput must complete within the timeout perious (by defaut 5 seconds) + * and it does not properly handle the block wrap at 65535 back to zero, + * so it will transmit data forever, or at least a very long time, if + * the timeout is set long enough, or the timeout issue is patched by + * itself. + */ +diff -Naru old/net/tftp.c new/net/tftp.c +--- old/net/tftp.c 2017-07-05 15:52:28.865818329 -0500 ++++ new/net/tftp.c 2017-07-11 16:15:27.870430395 -0500 +@@ -499,10 +499,15 @@ + int block = ntohs(*s); + int ack_ok = (tftp_cur_block == block); + ++ /* update_block_number needs tftp_prev_block */ ++ tftp_prev_block = tftp_cur_block; + tftp_cur_block = (unsigned short)(block + 1); + update_block_number(); +- if (ack_ok) ++ if (ack_ok) { ++ /* We got the ACK, so reset the timeout */ ++ net_set_timeout_handler(timeout_ms, tftp_timeout_handler); + tftp_send(); /* Send next data block */ ++ } + } + } + #endif |