A family that needs to carry state from one request of a socket to the
next, such as a table replace that arrives in several messages, has no
place for it.
Let a family register per-socket storage, as Linux does with
sock_priv: genl_register_sock_priv() gives its size and a destructor,
genl_sock_priv() returns the socket's storage to a handler of the
family, allocated on first use, and the storage is destroyed and freed
when the socket closes or the family is unregistered. The storage is
kept on a list per family under the generic netlink lock; a handler
can rely on it because the socket does not close while its handler
runs and genl_unregister_family() waits for running handlers.
Sponsored by: Rubicon Communications, LLC ("Netgate")