Commit 9c77b06b authored by Beniamino Galvani's avatar Beniamino Galvani

dhcp: systemd: support the hostname property

Send the FQDN option when a hostname is set.
parent 03637ad8
......@@ -915,6 +915,7 @@ ip6_start (NMDhcpClient *client,
NMDhcpSystemdPrivate *priv = NM_DHCP_SYSTEMD_GET_PRIVATE (self);
const char *iface = nm_dhcp_client_get_iface (client);
const GByteArray *hwaddr;
const char *hostname;
int r, i;
g_assert (priv->client4 == NULL);
......@@ -995,6 +996,13 @@ ip6_start (NMDhcpClient *client,
goto error;
hostname = nm_dhcp_client_get_hostname (client);
r = sd_dhcp6_client_set_fqdn (priv->client6, hostname);
if (r < 0) {
_LOGW ("failed to set DHCP hostname to '%s' (%d)", hostname, r);
goto error;
r = sd_dhcp6_client_start (priv->client6);
if (r < 0) {
_LOGW ("failed to start client (%d)", r);
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment