diff mbox series

net: tftp: fix tftp server initialization

Message ID AM0PR0402MB392329196DDBF0203225A7FABCE19@AM0PR0402MB3923.eurprd04.prod.outlook.com
State Accepted
Commit 1ffe366881a3fd474737f67f2e9fb5bf40104fd3
Delegated to: Ramon Fried
Headers show
Series net: tftp: fix tftp server initialization | expand

Commit Message

Arjan Minzinga Zijlstra March 31, 2022, 8:03 a.m. UTC
Some globals where not properly initialized causing timeouts
as data packets where not immediately acknowledged.

Signed-off-by: Arjan Minzinga Zijlstra <arjan.minzingazijlstra@fox-it.com>
---
 net/tftp.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Ramon Fried April 1, 2022, 7:43 p.m. UTC | #1
On Thu, Mar 31, 2022 at 2:50 PM Arjan Minzinga Zijlstra
<arjan.minzingazijlstra@fox-it.com> wrote:
>
> Some globals where not properly initialized causing timeouts
> as data packets where not immediately acknowledged.
I don't see a scenario where these two variables will not be initialized.
Can you please elaborate ?
>
> Signed-off-by: Arjan Minzinga Zijlstra <arjan.minzingazijlstra@fox-it.com>
> ---
>  net/tftp.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/net/tftp.c b/net/tftp.c
> index 62a9648474..9d5fe2f2d9 100644
> --- a/net/tftp.c
> +++ b/net/tftp.c
> @@ -912,6 +912,8 @@ void tftp_start_server(void)
>         tftp_block_size = TFTP_BLOCK_SIZE;
>         tftp_cur_block = 0;
>         tftp_our_port = WELL_KNOWN_PORT;
> +       tftp_windowsize = 1;
> +       tftp_next_ack = tftp_windowsize;
>
>  #ifdef CONFIG_TFTP_TSIZE
>         tftp_tsize = 0;
> --
> 2.25.1
Ramon Fried April 12, 2022, 7:40 p.m. UTC | #2
On Thu, Mar 31, 2022 at 2:50 PM Arjan Minzinga Zijlstra
<arjan.minzingazijlstra@fox-it.com> wrote:
>
> Some globals where not properly initialized causing timeouts
> as data packets where not immediately acknowledged.
>
> Signed-off-by: Arjan Minzinga Zijlstra <arjan.minzingazijlstra@fox-it.com>
> ---
>  net/tftp.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/net/tftp.c b/net/tftp.c
> index 62a9648474..9d5fe2f2d9 100644
> --- a/net/tftp.c
> +++ b/net/tftp.c
> @@ -912,6 +912,8 @@ void tftp_start_server(void)
>         tftp_block_size = TFTP_BLOCK_SIZE;
>         tftp_cur_block = 0;
>         tftp_our_port = WELL_KNOWN_PORT;
> +       tftp_windowsize = 1;
> +       tftp_next_ack = tftp_windowsize;
>
>  #ifdef CONFIG_TFTP_TSIZE
>         tftp_tsize = 0;
> --
> 2.25.1
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
diff mbox series

Patch

diff --git a/net/tftp.c b/net/tftp.c
index 62a9648474..9d5fe2f2d9 100644
--- a/net/tftp.c
+++ b/net/tftp.c
@@ -912,6 +912,8 @@  void tftp_start_server(void)
 	tftp_block_size = TFTP_BLOCK_SIZE;
 	tftp_cur_block = 0;
 	tftp_our_port = WELL_KNOWN_PORT;
+	tftp_windowsize = 1;
+	tftp_next_ack = tftp_windowsize;
 
 #ifdef CONFIG_TFTP_TSIZE
 	tftp_tsize = 0;