summaryrefslogtreecommitdiff
path: root/src/dhcp/nm-dhcp-systemd.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/dhcp/nm-dhcp-systemd.c')
-rw-r--r--src/dhcp/nm-dhcp-systemd.c30
1 files changed, 8 insertions, 22 deletions
diff --git a/src/dhcp/nm-dhcp-systemd.c b/src/dhcp/nm-dhcp-systemd.c
index 96be65ae1c..aa90270101 100644
--- a/src/dhcp/nm-dhcp-systemd.c
+++ b/src/dhcp/nm-dhcp-systemd.c
@@ -687,28 +687,14 @@ ip4_start (NMDhcpClient *client, const char *dhcp_anycast_addr, const char *last
hostname = nm_dhcp_client_get_hostname (client);
if (hostname) {
- if (nm_dhcp_client_get_use_fqdn (client)) {
- r = sd_dhcp_client_set_hostname (priv->client4, hostname);
- if (r < 0) {
- _LOGW ("failed to set DHCP FQDN (%d)", r);
- goto error;
- }
- } else {
- char *prefix, *dot;
-
- prefix = strdup (hostname);
- dot = strchr (prefix, '.');
- /* get rid of the domain */
- if (dot)
- *dot = '\0';
-
- r = sd_dhcp_client_set_hostname (priv->client4, prefix);
- free (prefix);
-
- if (r < 0) {
- _LOGW ("failed to set DHCP hostname (%d)", r);
- goto error;
- }
+ /* FIXME: sd-dhcp decides which hostname/FQDN option to send (12 or 81)
+ * only based on whether the hostname has a domain part or not. At the
+ * moment there is no way to force one or another.
+ */
+ r = sd_dhcp_client_set_hostname (priv->client4, hostname);
+ if (r < 0) {
+ _LOGW ("failed to set DHCP hostname to '%s' (%d)", hostname, r);
+ goto error;
}
}