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-12 15:16:15 +0200
commitd0b8b5506ddfa005e98040f5b3b4c57bcc2518c7 (patch)
treec589bd3dfb5f9dc3363d088b750d5492db8af835
parent87e67c202ae1c1e87166ad69aa71e2689abf51e9 (diff)
downloadNetworkManager-th/dhcp-factory-cleanup.tar.gz
dhcp: minor refactoring to switch default IPv4 DHCP plugin to "nettools" with one-line changeth/dhcp-factory-cleanup
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 ();
}