]> git.ipfire.org Git - thirdparty/systemd.git/commit
sd-netlink: revamp message serial handling
authorLennart Poettering <lennart@poettering.net>
Wed, 10 Feb 2021 16:59:46 +0000 (17:59 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 10 Feb 2021 21:01:24 +0000 (22:01 +0100)
commitb522c4b92a1a8999e008002f0a30acbaf58b55e4
tree2304db15601a569b47302677da18e5a52d1556b3
parent01131684ac66e82faae18e40e110089003d7c536
sd-netlink: revamp message serial handling

Let's use uint32_t everywhere to maintain the seqno, since that's what
the kernel does. Prviously in the reply_callback logic we used 64bit,
for no apparent reason.

Using 32bit also provides us with the benefit that we can avoid using
uint64_hash_ops, and can use trivial_hash_ops instead for the reply
hashmap, so that we can store the seqno in the key pointer directly.

While we are at it, let's make sure we never run into serial collisions
internally (32bit is a lot, but not that much), and let's put a limit on
outstanding serials, to catch programming errors.
src/libsystemd/sd-netlink/netlink-internal.h
src/libsystemd/sd-netlink/sd-netlink.c