Page MenuHomeFreeBSD

protosw: refactor protosw and domain static declaration and load
AbandonedPublic

Authored by glebius on Aug 16 2022, 7:50 PM.
Tags
None
Referenced Files
F170673918: D36232.id109436.diff
Sat, Sep 5, 11:15 PM
F170652850: D36232.id109436.diff
Sat, Sep 5, 8:08 PM
F170608909: D36232.id.diff
Sat, Sep 5, 3:19 PM
F170597032: D36232.id.diff
Sat, Sep 5, 2:02 PM
Unknown Object (File)
Sat, Sep 5, 7:27 AM
Unknown Object (File)
Sat, Sep 5, 1:29 AM
Unknown Object (File)
Sat, Sep 5, 12:32 AM
Unknown Object (File)
Thu, Sep 3, 5:04 PM

Details

Summary

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

Repository
rS FreeBSD src repository - subversion
Lint
Lint Warnings
SeverityLocationCodeMessage
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
Unit
No Test Coverage
Build Status
Buildable 46993
Build 43882: arc lint + arc unit

Event Timeline

melifaro added inline comments.
sys/kern/uipc_domain.c
387

Is this needed?

408

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.

477

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

501

Shouldn't we catch it on attach instead?