net: tftp: Avoid sending extra ack on completion
PATCH 1/1 net: tftp: Avoid sending extra ack on completion
in tftpboot, if ack was already sent previously for this packet, don't send again.
--- net/tftp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/tftp.c +2 -1
@@ -678,7 +678,8 @@ static void tftp_handler(uchar *pkt, unsigned dest, struct in_addr sip, }if (len < tftp_block_size) { -tftp_send (); +if (tftp_cur_block != tftp_next_ack) +tftp_send ();tftp_complete (); }break ;
Signature · 1 line
2.17.1
PATCH 1/1 net: tftp: Avoid sending extra ack on completion
Quoted 17 lines · Ramon Fried
in tftpboot, if ack was already sent previously for this packet, don't send again.
Fixes cc6b87ecaa96 ("net: tftp: Add client support for RFC 7440")Reported-by Suneel Garapati <[email protected]>Signed-off-by Ramon Fried <[email protected]>--- net/tftp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)net/tftp.c +0
-0
net/tftp.c static void tftp_handler(uchar *pkt, unsigned dest, struct in_addr sip, · line 682
Quoted 6 lines
net/tftp.c +2
-1@@ -678,7 +678,8 @@ static void tftp_handler(uchar *pkt, unsigned dest, struct in_addr sip, }if (len < tftp_block_size) { -tftp_send (); +if (tftp_cur_block != tftp_next_ack) +tftp_send ();
In the 'if' block above this, next_ack is incremented by window size already, so for size 1 this condition is always true.
And the extra ack is sent.
Quoted 6 lines
net/tftp.c +0
-1tftp_complete (); }break ; --2.17.1
PATCH 1/1 net: tftp: Avoid sending extra ack on completion
Quoted 21 lines · Suneel Garapati
Quoted 19 lines · Ramon Fried
in tftpboot, if ack was already sent previously for this packet, don't send again.
Fixes cc6b87ecaa96 ("net: tftp: Add client support for RFC 7440")Reported-by Suneel Garapati <[email protected]>Signed-off-by Ramon Fried <[email protected]>--- net/tftp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)net/tftp.c +0
-0@@ -678,7 +678,8 @@ static void tftp_handler(uchar *pkt, unsigned dest, struct in_addr sip, }
Quoted 14 lines
net/tftp.c static void tftp_handler(uchar *pkt, unsigned dest, struct in_addr sip, · line 682
Quoted 4 lines
net/tftp.c +2
-1if (len < tftp_block_size) { -tftp_send (); +if (tftp_cur_block != tftp_next_ack) +tftp_send ();In the 'if' block above this,
next_ackis incremented by window size already, so for size 1 this condition is always true.
And the extra ack is sent.Quoted 6 lines
net/tftp.c +0
-1tftp_complete (); }break ; --2.17.1
Yes, you're right, I'm not next to my setup, so I can't test it properly. Anyhow, I'm sending V2 now, I think now it's good. Can you test ? Thanks,
Ramon.
PATCH 1/1 net: tftp: Avoid sending extra ack on completion
Quoted 37 lines · Ramon Fried
Quoted 21 lines · Suneel Garapati
Quoted 19 lines · Ramon Fried
in tftpboot, if ack was already sent previously for this packet, don't send again.
Fixes cc6b87ecaa96 ("net: tftp: Add client support for RFC 7440")Reported-by Suneel Garapati <[email protected]>Signed-off-by Ramon Fried <[email protected]>--- net/tftp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)net/tftp.c +0
-0@@ -678,7 +678,8 @@ static void tftp_handler(uchar *pkt, unsigned dest, struct in_addr sip, }Quoted 14 lines
net/tftp.c static void tftp_handler(uchar *pkt, unsigned dest, struct in_addr sip, · line 682
Quoted 4 lines
net/tftp.c +2
-1if (len < tftp_block_size) { -tftp_send (); +if (tftp_cur_block != tftp_next_ack) +tftp_send ();In the 'if' block above this,
next_ackis incremented by window size already, so for size 1 this condition is always true.
And the extra ack is sent.Quoted 6 lines
net/tftp.c +0
-1tftp_complete (); }break ; --2.17.1
Quoted 4 lines
Yes, you're right, I'm not next to my setup, so I can't test it properly. Anyhow, I'm sending V2 now, I think now it's good. Can you test ? Thanks,
Ramon.
Tested without issues for window size 1.
Thanks,
Suneel