Page MenuHomeFreeBSD

sockets: use only soref()/sorele() as socket reference count
ClosedPublic

Authored by glebius on Jun 30 2022, 3:12 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Nov 25, 6:12 AM
Unknown Object (File)
Wed, Nov 20, 6:04 AM
Unknown Object (File)
Tue, Nov 19, 4:53 PM
Unknown Object (File)
Sat, Nov 2, 9:40 AM
Unknown Object (File)
Sat, Nov 2, 4:58 AM
Unknown Object (File)
Sat, Nov 2, 4:58 AM
Unknown Object (File)
Sat, Nov 2, 4:58 AM
Unknown Object (File)
Sat, Nov 2, 4:36 AM
Subscribers

Details

Summary

o Retire SS_FDREF as it is basically a debug flag on top of already

existing soref()/sorele().

o Convert SS_PROTOREF into soref()/sorele().
o Change reference model for the listen queues, see below.
o Make sofree() private. The correct KPI to use is only sorele().
o Make soabort() respect the model and sorele() instead of sofree().

Until now the sockets on a queue had zero reference count. And the
reference were given only upon accept(2). The assumption was that there
is no way to see the queued socket from anywhere except its head. This
is not true, since queued sockets already have pcbs, which are linked at
least into the global pcb lists. With this change we put the reference
right in the sonewconn() and on accept(2) path we just hand the existing
reference to the file descriptor.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 46209
Build 43098: arc lint + arc unit