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
Unknown Object (File)
Thu, Apr 2, 5:42 PM
Unknown Object (File)
Thu, Apr 2, 1:26 PM
Unknown Object (File)
Tue, Mar 31, 9:13 PM
Unknown Object (File)
Mon, Mar 30, 2:08 PM
Unknown Object (File)
Tue, Mar 24, 7:17 PM
Unknown Object (File)
Wed, Mar 18, 11:31 PM
Unknown Object (File)
Feb 8 2026, 1:36 PM
Unknown Object (File)
Feb 8 2026, 2:32 AM
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 Skipped
Unit
Tests Skipped
Build Status
Buildable 49541
Build 46431: arc lint + arc unit