sd-dhcp-server: set DHCPLease::server before hashmap_put()
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 26 Jan 2022 15:17:23 +0000 (00:17 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 1 Feb 2022 02:45:51 +0000 (11:45 +0900)
commit8a7d048d1ddb8916482f1422405d3e0e4bccb279
tree4beffb3ce7ee15287b9dfbee56b18272d8877612
parent37e219800fc34c0e6e54e02d943102957f945b56
sd-dhcp-server: set DHCPLease::server before hashmap_put()

Otherwise, if the second push is failed, then the first hashmap contains
dirty entry.

Also, this makes hashmap_remove_value() used when removing leases to
make not wrong lease is removed from the hashmap.

Note, this just hide the root cause of the issue #22253, which will be
fixed in later commit.

Fixes #22253.
src/libsystemd-network/sd-dhcp-server.c