sd-netlink: refcount multicast groups
Track the number of matches installed for a given multicast group, and leave the group once no matches depend on it. In order to handle passed-in sockets that are already members of multicast groups we initialize the refcount based on the membership once we take over the socket. This way we will leave the socket in the state we found it once we finish with it. On kernels that do not fully support reading out the multicast group membership we fall back to never leaving any groups (as before).
This commit is contained in:
@@ -126,6 +126,10 @@
|
||||
#define SOL_NETLINK 270
|
||||
#endif
|
||||
|
||||
#ifndef NETLINK_LIST_MEMBERSHIPS
|
||||
#define NETLINK_LIST_MEMBERSHIPS 9
|
||||
#endif
|
||||
|
||||
#if !HAVE_DECL_PIVOT_ROOT
|
||||
static inline int pivot_root(const char *new_root, const char *put_old) {
|
||||
return syscall(SYS_pivot_root, new_root, put_old);
|
||||
|
||||
Reference in New Issue
Block a user