sd-dhcp: clean-up of DHCP lease server code

System Internals / systemd - Lennart Poettering [poettering.net] - 30 May 2020 12:18 UTC

This is an attempt to clean-up the DHCP lease server type code a bit. We now strictly use the same enum everywhere, and store server info in an array. Moreover, we use the same nomenclature everywhere.

This only makes the changes in the sd-dhcp code. The networkd code is untouched so far (but should be fixed up like this too. But it's more complicated since this would then touch actual settings in .network files).

Note that this also changes some field names in serialized lease files. But given that these field names have not been part of a released
version of systemd yet, such a change should be ok.

This is pure renaming/refactoring, shouldn't actually change any behaviour.

ddb82ec2a2 sd-dhcp: clean-up of DHCP lease server code
src/libsystemd-network/dhcp-internal.h | 6 +-
src/libsystemd-network/dhcp-lease-internal.h | 22 +---
src/libsystemd-network/dhcp-server-internal.h | 3 +-
src/libsystemd-network/sd-dhcp-lease.c | 176 +++++++++-----------------
src/libsystemd-network/sd-dhcp-server.c | 145 ++++++---------------
src/libsystemd-network/test-dhcp-client.c | 3 +-
src/libsystemd-network/test-dhcp-option.c | 3 +
src/libsystemd-network/test-dhcp-server.c | 1 +
src/network/networkd-dhcp-server.c | 36 +++---
src/network/networkd-link.c | 20 +--
src/network/networkd-manager.c | 6 +-
src/network/networkd-util.c | 16 +--
src/network/networkd-util.h | 4 +-
src/systemd/sd-dhcp-lease.h | 27 ++--
src/systemd/sd-dhcp-server.h | 2 +-
15 files changed, 171 insertions(+), 299 deletions(-)

Upstream: github.com


  • Share