]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Various cleanups to the management of multiple TCP stacks.
authorJohn Baldwin <jhb@FreeBSD.org>
Wed, 27 Feb 2019 20:24:23 +0000 (20:24 +0000)
committerJohn Baldwin <jhb@FreeBSD.org>
Wed, 27 Feb 2019 20:24:23 +0000 (20:24 +0000)
commitdbcc2000582ffaead0573929ea660c582d5982d3
tree0f4f23b2d004492611cb24a75c92382e23e3ee93
parent62c47c7f6cdc6defa1dcd6a2ef39abb34a4c0351
Various cleanups to the management of multiple TCP stacks.

- 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.

Reviewed by: rrs
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D19152
sys/netinet/tcp_subr.c