summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2019-08-12 15:13:27 +0200
committerThomas Haller <thaller@redhat.com>2019-08-13 09:42:15 +0200
commit75503c85545110b8941562f3cd47ac602c5db454 (patch)
tree1b26b44f3673facc0afc33687082ac6297a3212f
parentb53e261427c925034ada6b90278b7e9077e2ea43 (diff)
downloadNetworkManager-75503c85545110b8941562f3cd47ac602c5db454.tar.gz
dhcp: minor refactoring to switch default IPv4 DHCP plugin to "nettools" with one-line change
Minor refactoring so that there is only a one-line change necessary to flip the implementation of the "internal" DHCP plugin for IPv4 from "systemd" to "nettools". We don't do that yet, because there are still some issues (e.g. the lease is not persisted for nettools plugin). Eventually we want to switch, so prepare the code to be almost there.
-rw-r--r--src/dhcp/nm-dhcp-client.h2
-rw-r--r--src/dhcp/nm-dhcp-nettools.c2
-rw-r--r--src/dhcp/nm-dhcp-systemd.c2
3 files changed, 4 insertions, 2 deletions
diff --git a/src/dhcp/nm-dhcp-client.h b/src/dhcp/nm-dhcp-client.h
index 551e2449a8..29f83259f8 100644
--- a/src/dhcp/nm-dhcp-client.h
+++ b/src/dhcp/nm-dhcp-client.h
@@ -214,6 +214,8 @@ typedef struct {
bool experimental:1;
} NMDhcpClientFactory;
+GType nm_dhcp_nettools_get_type (void);
+
extern const NMDhcpClientFactory _nm_dhcp_client_factory_dhcpcanon;
extern const NMDhcpClientFactory _nm_dhcp_client_factory_dhclient;
extern const NMDhcpClientFactory _nm_dhcp_client_factory_dhcpcd;
diff --git a/src/dhcp/nm-dhcp-nettools.c b/src/dhcp/nm-dhcp-nettools.c
index 292cfecc01..5191f5a4e9 100644
--- a/src/dhcp/nm-dhcp-nettools.c
+++ b/src/dhcp/nm-dhcp-nettools.c
@@ -55,8 +55,6 @@
typedef struct _NMDhcpNettools NMDhcpNettools;
typedef struct _NMDhcpNettoolsClass NMDhcpNettoolsClass;
-static GType nm_dhcp_nettools_get_type (void);
-
/*****************************************************************************/
typedef struct {
diff --git a/src/dhcp/nm-dhcp-systemd.c b/src/dhcp/nm-dhcp-systemd.c
index 0e30ab3883..f0084f1b86 100644
--- a/src/dhcp/nm-dhcp-systemd.c
+++ b/src/dhcp/nm-dhcp-systemd.c
@@ -1186,6 +1186,8 @@ _get_type_per_addr_family (int addr_family)
{
nm_assert_addr_family (addr_family);
+ if (FALSE && addr_family == AF_INET)
+ return nm_dhcp_nettools_get_type ();
return nm_dhcp_systemd_get_type ();
}