Page MenuHomeFreeBSD

protosw: refactor protosw and domain static declaration and load

Authored by glebius on Aug 16 2022, 7:50 PM.
Referenced Files
Unknown Object (File)
Thu, May 23, 10:11 PM
Unknown Object (File)
Wed, May 22, 3:07 AM
Unknown Object (File)
Wed, May 22, 2:35 AM
Unknown Object (File)
Wed, May 22, 2:34 AM
Unknown Object (File)
Mon, May 20, 2:53 AM
Unknown Object (File)
Mon, May 20, 1:43 AM
Unknown Object (File)
Fri, May 10, 4:43 PM
Unknown Object (File)
Wed, May 8, 2:56 AM



o Assert that every protosw has pr_attach. Now this structure is
only for socket protocols declarations and nothing else.
o Merge struct pr_usrreqs into struct protosw. This was suggested
in 1996 by wollman@ (see 7b187005d18ef), and later reiterated
in 2006 by rwatson@ (see 6fbb9cf860dcd).
o Make struct domain hold a variable sized array of protosw pointers.
For most protocols these pointers are initialized statically.
Those domains that may have loadable protocols have spacers. IPv4
and IPv6 have 8 spacers each (andre@ dff3237ee54ea).
o For inetsw and inet6sw leave a comment noting that many protosw
entries very likely are dead code.
o Refactor pf_proto_[un]register() into protow_[un]register().
o Isolate pr_*_notsupp() methods into uipc_domain.c

Diff Detail

rS FreeBSD src repository - subversion
Lint Warnings
Warningsys/compat/linuxkpi/common/include/linux/net.h:61SPELL1Possible Spelling Mistake
Warningsys/compat/linuxkpi/common/include/linux/net.h:63SPELL1Possible Spelling Mistake
Warningsys/kern/uipc_domain.c:81SPELL1Possible Spelling Mistake
Warningsys/kern/uipc_domain.c:93SPELL1Possible Spelling Mistake
Warningsys/kern/uipc_domain.c:99SPELL1Possible Spelling Mistake
Warningsys/kern/uipc_domain.c:106SPELL1Possible Spelling Mistake
Warningsys/kern/uipc_domain.c:112SPELL1Possible Spelling Mistake
Warningsys/kern/uipc_domain.c:144SPELL1Possible Spelling Mistake
Warningsys/kern/uipc_domain.c:196SPELL1Possible Spelling Mistake
Warningsys/kern/uipc_socket.c:921SPELL1Possible Spelling Mistake
Warningsys/kern/uipc_socket.c:932SPELL1Possible Spelling Mistake
Warningsys/kern/uipc_socket.c:1328SPELL1Possible Spelling Mistake
Warningsys/kern/uipc_socket.c:1362SPELL1Possible Spelling Mistake
Warningsys/kern/uipc_socket.c:1364SPELL1Possible Spelling Mistake
Warningsys/sys/protosw.h:244SPELL1Possible Spelling Mistake
No Test Coverage
Build Status
Buildable 46993
Build 43882: arc lint + arc unit

Event Timeline

melifaro added inline comments.

Is this needed?


Is this special case needed? E.g. if adding domains with AF_UNSPEC is not a valid use case, we would naturally return NULL after search.


maybe name prp like proto_slot so it can be a bit more readable?


Shouldn't we catch it on attach instead?