summaryrefslogtreecommitdiff
path: root/src/dhcp-manager/nm-dhcp-dhclient.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/dhcp-manager/nm-dhcp-dhclient.c')
-rw-r--r--src/dhcp-manager/nm-dhcp-dhclient.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/dhcp-manager/nm-dhcp-dhclient.c b/src/dhcp-manager/nm-dhcp-dhclient.c
index d9f51352c..c43ecf50c 100644
--- a/src/dhcp-manager/nm-dhcp-dhclient.c
+++ b/src/dhcp-manager/nm-dhcp-dhclient.c
@@ -455,8 +455,9 @@ dhclient_start (NMDHCPClient *client,
GError *error = NULL;
const char *iface, *uuid, *system_bus_address;
char *binary_name, *cmd_str, *pid_file = NULL, *system_bus_address_env = NULL;
- gboolean ipv6;
+ gboolean ipv6, success;
guint log_domain;
+ char *escaped;
g_return_val_if_fail (priv->pid_file == NULL, -1);
@@ -497,6 +498,20 @@ dhclient_start (NMDHCPClient *client,
return -1;
}
+ /* Save the DUID to the leasefile dhclient will actually use */
+ if (ipv6) {
+ escaped = nm_dhcp_dhclient_escape_duid (duid);
+ success = nm_dhcp_dhclient_save_duid (priv->lease_file, escaped, &error);
+ g_free (escaped);
+ if (!success) {
+ nm_log_warn (log_domain, "(%s): failed to save DUID to %s: (%d) %s.",
+ iface, priv->lease_file,
+ error ? error->code : -1,
+ error && error->message ? error->message : "(unknown)");
+ return -1;
+ }
+ }
+
argv = g_ptr_array_new ();
g_ptr_array_add (argv, (gpointer) priv->path);