* [PATCH] net: tftp: Fix incorrect tftp_next_ack on no OACK
@ 2020-11-27 21:45 Harm Berntsen
2020-12-14 21:36 ` Ramon Fried
2021-01-19 20:01 ` Tom Rini
0 siblings, 2 replies; 3+ messages in thread
From: Harm Berntsen @ 2020-11-27 21:45 UTC (permalink / raw)
To: u-boot
When the tftp server did not send any OACK, the tftp_next_ack variable
was not set to the correct value . As the server was transmitting
blocks we generated a lot of 'Received unexpected block: $n, expected
$n+1' error messages. Depending on the timeout setting the transfer
could still complete though.
Signed-off-by: Harm Berntsen <harm.berntsen@nedap.com>
CC: Ramon Fried <rfried.dev@gmail.com>
---
net/tftp.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/net/tftp.c b/net/tftp.c
index 6fdb1a821a..9371d7ef2c 100644
--- a/net/tftp.c
+++ b/net/tftp.c
@@ -624,8 +624,10 @@ static void tftp_handler(uchar *pkt, unsigned dest, struct in_addr sip,
tftp_cur_block++;
tftp_cur_block %= TFTP_SEQUENCE_SIZE;
- if (tftp_state == STATE_SEND_RRQ)
+ if (tftp_state == STATE_SEND_RRQ) {
debug("Server did not acknowledge any options!\n");
+ tftp_next_ack = tftp_windowsize;
+ }
if (tftp_state == STATE_SEND_RRQ || tftp_state == STATE_OACK ||
tftp_state == STATE_RECV_WRQ) {
--
2.29.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH] net: tftp: Fix incorrect tftp_next_ack on no OACK
2020-11-27 21:45 [PATCH] net: tftp: Fix incorrect tftp_next_ack on no OACK Harm Berntsen
@ 2020-12-14 21:36 ` Ramon Fried
2021-01-19 20:01 ` Tom Rini
1 sibling, 0 replies; 3+ messages in thread
From: Ramon Fried @ 2020-12-14 21:36 UTC (permalink / raw)
To: u-boot
On Fri, Nov 27, 2020 at 11:45 PM Harm Berntsen <harm.berntsen@nedap.com> wrote:
>
> When the tftp server did not send any OACK, the tftp_next_ack variable
> was not set to the correct value . As the server was transmitting
> blocks we generated a lot of 'Received unexpected block: $n, expected
> $n+1' error messages. Depending on the timeout setting the transfer
> could still complete though.
>
> Signed-off-by: Harm Berntsen <harm.berntsen@nedap.com>
> CC: Ramon Fried <rfried.dev@gmail.com>
> ---
>
> net/tftp.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/net/tftp.c b/net/tftp.c
> index 6fdb1a821a..9371d7ef2c 100644
> --- a/net/tftp.c
> +++ b/net/tftp.c
> @@ -624,8 +624,10 @@ static void tftp_handler(uchar *pkt, unsigned dest, struct in_addr sip,
> tftp_cur_block++;
> tftp_cur_block %= TFTP_SEQUENCE_SIZE;
>
> - if (tftp_state == STATE_SEND_RRQ)
> + if (tftp_state == STATE_SEND_RRQ) {
> debug("Server did not acknowledge any options!\n");
> + tftp_next_ack = tftp_windowsize;
> + }
>
> if (tftp_state == STATE_SEND_RRQ || tftp_state == STATE_OACK ||
> tftp_state == STATE_RECV_WRQ) {
> --
> 2.29.2
>
>
Reviewed-By: Ramon Fried <rfried.dev@gmail.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] net: tftp: Fix incorrect tftp_next_ack on no OACK
2020-11-27 21:45 [PATCH] net: tftp: Fix incorrect tftp_next_ack on no OACK Harm Berntsen
2020-12-14 21:36 ` Ramon Fried
@ 2021-01-19 20:01 ` Tom Rini
1 sibling, 0 replies; 3+ messages in thread
From: Tom Rini @ 2021-01-19 20:01 UTC (permalink / raw)
To: u-boot
On Fri, Nov 27, 2020 at 09:45:56PM +0000, Harm Berntsen wrote:
> When the tftp server did not send any OACK, the tftp_next_ack variable
> was not set to the correct value . As the server was transmitting
> blocks we generated a lot of 'Received unexpected block: $n, expected
> $n+1' error messages. Depending on the timeout setting the transfer
> could still complete though.
>
> Signed-off-by: Harm Berntsen <harm.berntsen@nedap.com>
> CC: Ramon Fried <rfried.dev@gmail.com>
> Reviewed-By: Ramon Fried <rfried.dev@gmail.com>
Applied to u-boot/master, thanks!
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210119/e99710bb/attachment.sig>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-01-19 20:01 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-27 21:45 [PATCH] net: tftp: Fix incorrect tftp_next_ack on no OACK Harm Berntsen
2020-12-14 21:36 ` Ramon Fried
2021-01-19 20:01 ` Tom Rini
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.