Page MenuHomeFreeBSD

libsa: Consolidate tftp sendrecv into net.c sendrecv
ClosedPublic

Authored by kevans on Feb 14 2018, 5:09 PM.
Tags
None
Referenced Files
Unknown Object (File)
Oct 17 2024, 3:58 AM
Unknown Object (File)
Oct 9 2024, 8:41 PM
Unknown Object (File)
Oct 2 2024, 4:22 AM
Unknown Object (File)
Sep 30 2024, 3:07 AM
Unknown Object (File)
Sep 27 2024, 12:06 PM
Unknown Object (File)
Sep 26 2024, 5:08 AM
Unknown Object (File)
Sep 22 2024, 11:52 PM
Unknown Object (File)
Sep 18 2024, 11:32 AM
Subscribers

Details

Summary

bootp/arp/rarp/rpc all use the sendrecv implementation in net.c. tftp has its own implementation because it passes an extra parameter into the recv callback for the received payload type to be held.

These sendrecv implementations are otherwise equivalent, so consolidate them. The other users of sendrecv won't be using the extra argument to recv, but this gives us only one place to worry about respecting timeouts and one consistent timeout behavior.

As an aside, it's not obvious to me why receives don't respect MAXTMO in sendrecv. I guess it's assumed that we'll hit a connection error before we hit MAXTMO, but I'm not sure if we want to count on this.

Test Plan

Ask @sbruno nicely to test with his tftp reboot loop, make sure it doesn't break periodically as it did before r329264

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

sbruno requested changes to this revision.Feb 14 2018, 10:18 PM

Quick and dirty assessment: BTX panics. :-( More review to come.

This revision now requires changes to proceed.Feb 14 2018, 10:18 PM

Oh, crap, right, that's not going to work. I'll redo this later tonight, recvtftp needs a little more

OK, sorry about that- forgot to deal with the fact that sendrecv's passing a stuct iodesc * as the first parameter. =( Should be good now, and I really need to setup a network so I can at least smoke test this stuff...

This revision is now accepted and ready to land.Feb 15 2018, 6:26 PM
This revision was automatically updated to reflect the committed changes.