From d3c7083f976f0e769d7f0b55c3024084e46667b1 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Mon, 7 Oct 2019 16:41:46 +0200 Subject: [PATCH] dhcp: switch IPv4 "internal" DHCP client to use "nettools" backend instead of "systemd" Previously, our "internal" DHCPv4 client is based on a fork of systemd code. This manner of maintaining the fork is problematic. The solution is to use a proper library: n-dhcp4 from the nettools project. We already have these two as undocumented plugins available, by setting either "dhcp=systemd" or "dhcp=nettools". This is only for testing. Users are only supposed to use the "internal" plugin. Up until now, the "internal" DHCPv4 plugin was based on "systemd" code. Change that to use "nettools" instead. Possibly this breaks something, and we need to fix it. But do this early so we have time to test the nettools plugin and identify issues. For the user, this change should be entirely transparant. https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/302 --- NEWS | 2 ++ src/dhcp/nm-dhcp-systemd.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 3ae54472f1..e7ee0b99bb 100644 --- a/NEWS +++ b/NEWS @@ -23,6 +23,8 @@ USE AT YOUR OWN RISK. NOT RECOMMENDED FOR PRODUCTION USE! * libnm: retire deprecated WiMAX API NMDeviceWimax and NMWimaxNsp. WiMAX support was removed from NetworkManager in version 1.2 (2016) and no such type instances would have been created by NMClient for a while now. +* DHCP: switch "internal" DHCPv4 plugin from code based on systemd to use nettools' + n-dhcp4 library. ============================================= NetworkManager-1.20 diff --git a/src/dhcp/nm-dhcp-systemd.c b/src/dhcp/nm-dhcp-systemd.c index 9ce39ebfd5..1518d46576 100644 --- a/src/dhcp/nm-dhcp-systemd.c +++ b/src/dhcp/nm-dhcp-systemd.c @@ -1099,7 +1099,7 @@ _get_type_per_addr_family (int addr_family) { nm_assert_addr_family (addr_family); - if (FALSE && addr_family == AF_INET) + if (addr_family == AF_INET) return nm_dhcp_nettools_get_type (); return nm_dhcp_systemd_get_type (); }