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)
Thu, Apr 25, 10:20 PM
Unknown Object (File)
Tue, Apr 16, 10:18 AM
Unknown Object (File)
Mar 29 2024, 5:01 PM
Unknown Object (File)
Mar 29 2024, 4:19 PM
Unknown Object (File)
Mar 28 2024, 5:50 AM
Unknown Object (File)
Feb 26 2024, 3:11 AM
Unknown Object (File)
Feb 23 2024, 3:07 PM
Unknown Object (File)
Feb 4 2024, 3:40 PM
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.