network: clean-up DHCP lease server data configuration

System Internals / systemd - Lennart Poettering [poettering.net] - 18 June 2020 04:08 EDT

This is an attempt to clean up the POP3/SMTP/LPR/… DHCP lease server data logic in networkd. This reduces code duplication and fixes a number of bugs.

This removes any support for collecting POP3/SMPT/LPR servers acquired
via local DHCP client releases since noone uses that, and given how old these protocols are I doubt this will change. It keeps support for configuring them for the dhcp server however.

The differences between the DNS/NTP/SIP/POP3/SMTP/LPR configuration logics are minimized.

This removes the relevant symbols from sd-network.h (which is an internal API only at this point after all).

This is unfortunately not well test, given the old code for this had barely any tests. But the new code should not perform worse at least, and allow us to release, since it corrects some interfaces visible in the .network configuration format.

Fixes: #15943

2a71d57f4e network: clean-up DHCP lease server data configuration
NEWS | 2 +-
man/systemd.network.xml | 101 ++----
src/libsystemd/sd-network/sd-network.c | 16 -
src/network/networkctl.c | 15 +-
src/network/networkd-dhcp-server.c | 373 +++++++----------------
src/network/networkd-dhcp-server.h | 7 +-
src/network/networkd-link.c | 25 +-
src/network/networkd-link.h | 3 +-
src/network/networkd-manager.c | 45 +--
src/network/networkd-network-gperf.gperf | 21 +-
src/network/networkd-network.c | 18 +-
src/network/networkd-network.h | 33 +-
src/systemd/sd-dhcp-server.h | 4 +-
src/systemd/sd-network.h | 12 -
test/fuzz/fuzz-network-parser/directives.network | 9 +-
15 files changed, 178 insertions(+), 506 deletions(-)

Upstream: github.com


  • Share