Commit ad9b8d5c authored by cuiyue's avatar cuiyue
Browse files

policy: get the DHCPv4 hostname from the FQDN option

Read the 'fqdn-hostname' option that carries the FQDN assigned by the
server to the client when the 'host-name' option is not found
parent bffb7535
Pipeline #616928 passed with stages
in 34 minutes and 8 seconds
......@@ -887,6 +887,9 @@ update_system_hostname(NMPolicy *self, const char *msg)
dhcp_hostname =
info->IS_IPv4 ? "host_name" : "fqdn_fqdn");
if (dhcp_hostname == NULL && info->IS_IPv4) {
dhcp_hostname = nm_dhcp_config_get_option(dhcp_config, "fqdn_hostname");
if (dhcp_hostname && dhcp_hostname[0]) {
p = nm_str_skip_leading_spaces(dhcp_hostname);
if (p[0]) {
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment