dhcp4: send FQDN option when ipv4.dhcp-fqdn is set

Modify the 3 DHCP client backends to support the new property.
This commit is contained in:
Beniamino Galvani
2015-10-13 15:13:26 +02:00
parent cba0f4e3c4
commit c3573ebf2b
12 changed files with 122 additions and 31 deletions

View File

@@ -531,7 +531,7 @@ ip4_start (NMDhcpClient *client, const char *dhcp_anycast_addr, const char *last
const uint8_t *client_id = NULL;
size_t client_id_len = 0;
struct in_addr last_addr = { 0 };
const char *hostname;
const char *hostname, *fqdn;
int r, i;
gboolean success = FALSE;
@@ -646,6 +646,15 @@ ip4_start (NMDhcpClient *client, const char *dhcp_anycast_addr, const char *last
}
}
fqdn = nm_dhcp_client_get_fqdn (client);
if (fqdn) {
r = sd_dhcp_client_set_hostname (priv->client4, fqdn);
if (r < 0) {
nm_log_warn (LOGD_DHCP4, "(%s): failed to set DHCP FQDN (%d)", iface, r);
goto error;
}
}
r = sd_dhcp_client_start (priv->client4);
if (r < 0) {
nm_log_warn (LOGD_DHCP4, "(%s): failed to start DHCP (%d)", iface, r);