summary refs log tree commit diff
path: root/src/dhcp
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2018-07-01 20:58:23 +0200
committerMichael Biebl <biebl@debian.org>2018-07-01 20:58:23 +0200
commit429393567647935d9123e21fd27a7529d50255eb (patch)
treeb5a99bf0cbbe77fccd7fee81caf71915ccf9eb96 /src/dhcp
parent069cb5c3a525ebcc19cc2927964258acaca87b13 (diff)
New upstream version 1.12.0 upstream/1.12.0
Diffstat (limited to 'src/dhcp')
-rw-r--r--src/dhcp/nm-dhcp-client.c11
-rw-r--r--src/dhcp/nm-dhcp-client.h6
-rw-r--r--src/dhcp/nm-dhcp-dhclient.c4
-rw-r--r--src/dhcp/nm-dhcp-manager.c4
-rw-r--r--src/dhcp/nm-dhcp-manager.h2
-rw-r--r--src/dhcp/nm-dhcp-utils.h6
6 files changed, 11 insertions, 22 deletions
diff --git a/src/dhcp/nm-dhcp-client.c b/src/dhcp/nm-dhcp-client.c
index 390b7054..360bd367 100644
--- a/src/dhcp/nm-dhcp-client.c
+++ b/src/dhcp/nm-dhcp-client.c
@@ -513,7 +513,7 @@ nm_dhcp_client_start_ip4 (NMDhcpClient *self,
 }
 
 static GBytes *
-get_duid (NMDhcpClient *self, gboolean global)
+get_duid (NMDhcpClient *self)
 {
 	return NULL;
 }
@@ -521,7 +521,7 @@ get_duid (NMDhcpClient *self, gboolean global)
 gboolean
 nm_dhcp_client_start_ip6 (NMDhcpClient *self,
                           GBytes *client_id,
-                          NMDhcpDuidEnforce enforce_duid,
+                          gboolean enforce_duid,
                           const char *dhcp_anycast_addr,
                           const struct in6_addr *ll_addr,
                           const char *hostname,
@@ -541,12 +541,9 @@ nm_dhcp_client_start_ip6 (NMDhcpClient *self,
 	nm_assert (!priv->duid);
 	nm_assert (client_id);
 
-	if (enforce_duid == NM_DHCP_DUID_ENFORCE_NEVER)
-		priv->duid = NM_DHCP_CLIENT_GET_CLASS (self)->get_duid (self, TRUE);
-	else if (enforce_duid == NM_DHCP_DUID_ENFORCE_LEASE_FALLBACK)
-		priv->duid = NM_DHCP_CLIENT_GET_CLASS (self)->get_duid (self, FALSE);
+	if (!enforce_duid)
+		priv->duid = NM_DHCP_CLIENT_GET_CLASS (self)->get_duid (self);
 
-	/* NM_DHCP_DUID_ENFORCE_ALWAYS and fallback */
 	if (!priv->duid)
 		priv->duid = g_bytes_ref (client_id);
 
diff --git a/src/dhcp/nm-dhcp-client.h b/src/dhcp/nm-dhcp-client.h
index 98c3ed26..f3d0b7d1 100644
--- a/src/dhcp/nm-dhcp-client.h
+++ b/src/dhcp/nm-dhcp-client.h
@@ -96,15 +96,13 @@ typedef struct {
 	/**
 	 * get_duid:
 	 * @self: the #NMDhcpClient
-	 * @global: if set to #true, the duid should be searched also in the
-	 *          DHCP client's system-wide persistent configuration.
 	 *
 	 * Attempts to find an existing DHCPv6 DUID for this client in the DHCP
 	 * client's persistent configuration.  Returned DUID should be the binary
 	 * representation of the DUID.  If no DUID is found, %NULL should be
 	 * returned.
 	 */
-	GBytes *(*get_duid) (NMDhcpClient *self, gboolean global);
+	GBytes *(*get_duid) (NMDhcpClient *self);
 
 	/* Signals */
 	void (*state_changed) (NMDhcpClient *self,
@@ -153,7 +151,7 @@ gboolean nm_dhcp_client_start_ip4 (NMDhcpClient *self,
 
 gboolean nm_dhcp_client_start_ip6 (NMDhcpClient *self,
                                    GBytes *client_id,
-                                   NMDhcpDuidEnforce enforce_duid,
+                                   gboolean enforce_duid,
                                    const char *dhcp_anycast_addr,
                                    const struct in6_addr *ll_addr,
                                    const char *hostname,
diff --git a/src/dhcp/nm-dhcp-dhclient.c b/src/dhcp/nm-dhcp-dhclient.c
index 43746dd3..3bd14ebe 100644
--- a/src/dhcp/nm-dhcp-dhclient.c
+++ b/src/dhcp/nm-dhcp-dhclient.c
@@ -582,7 +582,7 @@ state_changed (NMDhcpClient *client,
 }
 
 static GBytes *
-get_duid (NMDhcpClient *client, gboolean global)
+get_duid (NMDhcpClient *client)
 {
 	NMDhcpDhclient *self = NM_DHCP_DHCLIENT (client);
 	NMDhcpDhclientPrivate *priv = NM_DHCP_DHCLIENT_GET_PRIVATE (self);
@@ -607,7 +607,7 @@ get_duid (NMDhcpClient *client, gboolean global)
 		g_free (leasefile);
 	}
 
-	if (!duid && global) {
+	if (!duid) {
 		/* Otherwise read the default machine-wide DUID */
 		_LOGD ("looking for default DUID in '%s'", priv->def_leasefile);
 		duid = nm_dhcp_dhclient_read_duid (priv->def_leasefile, &error);
diff --git a/src/dhcp/nm-dhcp-manager.c b/src/dhcp/nm-dhcp-manager.c
index 2d85c73a..67254323 100644
--- a/src/dhcp/nm-dhcp-manager.c
+++ b/src/dhcp/nm-dhcp-manager.c
@@ -164,7 +164,7 @@ client_start (NMDhcpManager *self,
               guint32 route_metric,
               const struct in6_addr *ipv6_ll_addr,
               GBytes *dhcp_client_id,
-              NMDhcpDuidEnforce enforce_duid,
+              gboolean enforce_duid,
               guint32 timeout,
               const char *dhcp_anycast_addr,
               const char *hostname,
@@ -299,7 +299,7 @@ nm_dhcp_manager_start_ip6 (NMDhcpManager *self,
                            gboolean send_hostname,
                            const char *dhcp_hostname,
                            GBytes *duid,
-                           NMDhcpDuidEnforce enforce_duid,
+                           gboolean enforce_duid,
                            guint32 timeout,
                            const char *dhcp_anycast_addr,
                            gboolean info_only,
diff --git a/src/dhcp/nm-dhcp-manager.h b/src/dhcp/nm-dhcp-manager.h
index ed8ee742..7eb32c37 100644
--- a/src/dhcp/nm-dhcp-manager.h
+++ b/src/dhcp/nm-dhcp-manager.h
@@ -73,7 +73,7 @@ NMDhcpClient * nm_dhcp_manager_start_ip6     (NMDhcpManager *manager,
                                               gboolean send_hostname,
                                               const char *dhcp_hostname,
                                               GBytes *duid,
-                                              NMDhcpDuidEnforce enforce_duid,
+                                              gboolean enforce_duid,
                                               guint32 timeout,
                                               const char *dhcp_anycast_addr,
                                               gboolean info_only,
diff --git a/src/dhcp/nm-dhcp-utils.h b/src/dhcp/nm-dhcp-utils.h
index afb87c1a..5c127bd1 100644
--- a/src/dhcp/nm-dhcp-utils.h
+++ b/src/dhcp/nm-dhcp-utils.h
@@ -24,12 +24,6 @@
 #include "nm-ip4-config.h"
 #include "nm-ip6-config.h"
 
-typedef enum {
-	NM_DHCP_DUID_ENFORCE_NEVER = 0,
-	NM_DHCP_DUID_ENFORCE_LEASE_FALLBACK,
-	NM_DHCP_DUID_ENFORCE_ALWAYS,
-} NMDhcpDuidEnforce;
-
 NMIP4Config *nm_dhcp_utils_ip4_config_from_options (struct _NMDedupMultiIndex *multi_idx,
                                                     int ifindex,
                                                     const char *iface,