Page MenuHomeFreeBSD

netlink: Let a generic netlink family keep state per socket
Needs ReviewPublic

Authored by rcm on Fri, Oct 9, 1:13 PM.
Tags
None
Referenced Files
F175288443: D60521.id189231.diff
Fri, Oct 9, 5:05 PM
F175287694: D60521.id189231.diff
Fri, Oct 9, 4:59 PM
F175281983: D60521.diff
Fri, Oct 9, 4:20 PM
F175280810: D60521.diff
Fri, Oct 9, 4:14 PM
Subscribers

Details

Summary

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")

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped