]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/basic/missing.h
sd-netlink: refcount multicast groups 1581/head
authorTom Gundersen <teg@jklm.no>
Thu, 15 Oct 2015 15:59:10 +0000 (17:59 +0200)
committerTom Gundersen <teg@jklm.no>
Thu, 15 Oct 2015 16:59:08 +0000 (18:59 +0200)
commit9c5a882b7fc256ddc0b227677fa06546f0e944a8
tree4aa947709c998d12e77acbfe21264aa2c2c79404
parentf10dc5a72587cb35ef8e4f1babcb274ccb4afd45
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).
src/basic/missing.h
src/libsystemd/sd-netlink/netlink-internal.h
src/libsystemd/sd-netlink/netlink-socket.c
src/libsystemd/sd-netlink/sd-netlink.c