mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-07 00:30:32 +01:00
ifcfg-rh: fix handling of DHCP_SEND_HOSTNAME when no hostname is given
Move DHCP_SEND_HOSTNAME parsing out of the check for DHCP_HOSTNAME so that users can disable NM sending the system hostname to the DHCP server when DHCP_HOSTNAME is not defined.
This commit is contained in:
parent
91eafe95a3
commit
0b3fdd073e
1 changed files with 6 additions and 5 deletions
|
|
@ -1365,13 +1365,14 @@ make_ip4_setting (shvarFile *ifcfg,
|
|||
if (!strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_AUTO)) {
|
||||
value = svGetValue (ifcfg, "DHCP_HOSTNAME", FALSE);
|
||||
if (value && strlen (value))
|
||||
g_object_set (s_ip4,
|
||||
NM_SETTING_IP4_CONFIG_DHCP_HOSTNAME, value,
|
||||
NM_SETTING_IP4_CONFIG_DHCP_SEND_HOSTNAME,
|
||||
svTrueValue (ifcfg, "DHCP_SEND_HOSTNAME", TRUE),
|
||||
NULL);
|
||||
g_object_set (s_ip4, NM_SETTING_IP4_CONFIG_DHCP_HOSTNAME, value, NULL);
|
||||
g_free (value);
|
||||
|
||||
g_object_set (s_ip4,
|
||||
NM_SETTING_IP4_CONFIG_DHCP_SEND_HOSTNAME,
|
||||
svTrueValue (ifcfg, "DHCP_SEND_HOSTNAME", TRUE),
|
||||
NULL);
|
||||
|
||||
value = svGetValue (ifcfg, "DHCP_CLIENT_ID", FALSE);
|
||||
if (value && strlen (value))
|
||||
g_object_set (s_ip4, NM_SETTING_IP4_CONFIG_DHCP_CLIENT_ID, value, NULL);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue