Page MenuHomeFreeBSD

Various cleanups to the management of multiple TCP stacks.
ClosedPublic

Authored by jhb on Feb 11 2019, 11:47 PM.

Details

Summary

I could split this up into separate commits, or do them all as one merged
commit. I've only done very simple testing of these (boot and pass
traffic with the default stack). Feel free to add more reviewers.

Use strlcpy() with sizeof() instead of strncpy().

Simplify initialization of TCP functions structures.

init_tcp_functions() was already called before the first call to register
a stack. Just inline the work in the SYSINIT and remove the racy helper
variable. Instead, KASSERT that the rw lock is initialized when registering
a stack.

Protect the default stack via a direct pointer comparison.

The default stack uses the name "freebsd" instead of "default" so this
protection wasn't working for the default stack anyway.

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

jhb created this revision.Feb 11 2019, 11:47 PM
rrs accepted this revision.Feb 19 2019, 11:22 AM
This revision is now accepted and ready to land.Feb 19 2019, 11:22 AM
This revision was automatically updated to reflect the committed changes.