mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-07 13:20:27 +01:00
policy: fix setting hostname from DHCP options (rh #719100)
This commit fixes a regression introduced by commit
6272052f9d.
dhclient prefixes options with "new_", however we remove that prefix
before putting options into NMDHCP4Config.
This commit is contained in:
parent
6e92c1b606
commit
74615ce23c
1 changed files with 2 additions and 2 deletions
|
|
@ -322,7 +322,7 @@ update_system_hostname (NMPolicy *policy, NMDevice *best4, NMDevice *best6)
|
|||
/* Grab a hostname out of the device's DHCP4 config */
|
||||
dhcp4_config = nm_device_get_dhcp4_config (best4);
|
||||
if (dhcp4_config) {
|
||||
p = dhcp_hostname = nm_dhcp4_config_get_option (dhcp4_config, "new_host_name");
|
||||
p = dhcp_hostname = nm_dhcp4_config_get_option (dhcp4_config, "host_name");
|
||||
if (dhcp_hostname && strlen (dhcp_hostname)) {
|
||||
/* Sanity check; strip leading spaces */
|
||||
while (*p) {
|
||||
|
|
@ -341,7 +341,7 @@ update_system_hostname (NMPolicy *policy, NMDevice *best4, NMDevice *best6)
|
|||
/* Grab a hostname out of the device's DHCP6 config */
|
||||
dhcp6_config = nm_device_get_dhcp6_config (best6);
|
||||
if (dhcp6_config) {
|
||||
p = dhcp_hostname = nm_dhcp6_config_get_option (dhcp6_config, "new_host_name");
|
||||
p = dhcp_hostname = nm_dhcp6_config_get_option (dhcp6_config, "host_name");
|
||||
if (dhcp_hostname && strlen (dhcp_hostname)) {
|
||||
/* Sanity check; strip leading spaces */
|
||||
while (*p) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue