HomeFreeBSD

Improve carp(4) locking:

Description

Improve carp(4) locking:

  • Use the carp_sx to serialize not only CARP ioctls, but also carp_attach() and carp_detach().
  • Use cif_mtx to lock only access to those the linked list.
  • These locking changes allow us to do some memory allocations with M_WAITOK and also properly call callout_drain() in carp_destroy().
  • In carp_attach() assert that ifaddr isn't attached. We always come here with a pristine address from in[6]_control().

Reviewed by: oleg
Sponsored by: Nginx, Inc.

Details