Page MenuHomeFreeBSD

tftpd: Use poll() instead of alarm() + setjmp().
ClosedPublic

Authored by des on Mar 7 2023, 11:03 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Jan 23, 6:50 PM
Unknown Object (File)
Thu, Jan 23, 6:36 PM
Unknown Object (File)
Sat, Jan 18, 5:56 PM
Unknown Object (File)
Dec 15 2024, 4:18 PM
Unknown Object (File)
Dec 13 2024, 2:55 PM
Unknown Object (File)
Dec 12 2024, 2:24 PM
Unknown Object (File)
Nov 29 2024, 5:15 PM
Unknown Object (File)
Oct 16 2024, 7:32 AM
Subscribers

Details

Summary

While there, don't log an error when timing out waiting for a possible retransmit after a successful transfer.

Sponsored by: Klara, Inc.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

des requested review of this revision.Mar 7 2023, 11:03 PM
des created this revision.
markj added inline comments.
libexec/tftpd/tftp-io.c
380

Why not add a new parameter which lets the caller indicate what it wants?

401

Shouldn't we always log an error if poll() returns -1?

libexec/tftpd/tftp-transfer.c
439

I think a comment should explain why we don't want an error message here.

libexec/tftpd/tftp-io.c
380

I'm trying to change as little as possible.

401

It can't happen.

libexec/tftpd/tftp-io.c
401

It can, if a bug elsewhere causes peer to be an invalid fd.

413

This check is always false.

libexec/tftpd/tftp-io.c
401

I'm confident that it can't happen. This isn't a library function that needs to take all possible contingencies into account.

413

Correct, the previous check should be removed as it's already been handled (even before my changes).

libexec/tftpd/tftp-transfer.c
439

Isn't it obvious? We expect to time out here, unless our final ACK was lost, causing the client to retransmit their final data packet.

Drop redundant timeout check.

des marked 4 inline comments as done.Mar 8 2023, 6:16 PM
This revision is now accepted and ready to land.Mar 8 2023, 6:29 PM
This revision was automatically updated to reflect the committed changes.