mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-27 21:00:10 +01:00
dhcp: systemd: support the hostname property
Send the FQDN option when a hostname is set.
This commit is contained in:
parent
03637ad8b5
commit
9c77b06bbc
1 changed files with 8 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue