tftp icon indicating copy to clipboard operation
tftp copied to clipboard

Server in single-port mode stops responding if non-existing file requested

Open waldner opened this issue 1 year ago • 1 comments

When using single-port mode, using the provided sample code for the readHandler, as long as existing files are requested, everything works fine. When a non-existent file is requested, the open nofile: no such file or directory message is displayed, err is returned but then subsequent requests from the client are just ignored.

waldner avatar Oct 16 '24 13:10 waldner

So it turns out this was due to a misbehaving tftp client, which was sending an unexpected ACK after an error was received from the server, corrupting the server status and preventing it from processing further packets. The RFC is pretty clear that error packets should not be acknowledged. Even if this is due to a bad client, I think the fix is simple and helps making the code more robust, so I've opened https://github.com/pin/tftp/pull/102 with what I believe is the fix.

waldner avatar Oct 18 '24 23:10 waldner