Page MenuHomeFreeBSD

tcp: Remove a couple of always-false checks from syncache_socket()
ClosedPublic

Authored by markj on Feb 5 2023, 9:05 PM.
Tags
None
Referenced Files
F140079177: D38391.diff
Fri, Dec 19, 11:16 PM
Unknown Object (File)
Wed, Dec 10, 2:48 AM
Unknown Object (File)
Sun, Nov 30, 9:10 PM
Unknown Object (File)
Nov 7 2025, 3:20 AM
Unknown Object (File)
Nov 1 2025, 6:00 AM
Unknown Object (File)
Oct 27 2025, 7:52 AM
Unknown Object (File)
Oct 26 2025, 6:37 PM
Unknown Object (File)
Oct 16 2025, 11:18 PM
Subscribers

Details

Summary

syncache_socket() does some unnecessary work: before connecting the PCB,
it saves the local address on the stack and restores it before freeing
the PCB in case of an error. However:

  • There's no need to restore the old address in the error case.
  • The PCB's local address will always be equal to that of the syncache entry anyway.

So just remove this unnecessary code, which appears to date from the
introduction of the syncache 20+ years ago.

No functional change intended.

Diff Detail

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