NetworkManager/rh719100-dhcp-hostname-fix.patch
2011-10-21 10:38:10 +02:00

45 lines
1.8 KiB
Diff

From 74615ce23c8db9bbb4404860523feed1c9a5ffc8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= <jklimes@redhat.com>
Date: Thu, 20 Oct 2011 16:51:02 +0200
Subject: [PATCH] policy: fix setting hostname from DHCP options (rh #719100)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This commit fixes a regression introduced by commit
6272052f9dd9a27a2253515f47c8414ed53c09cf.
dhclient prefixes options with "new_", however we remove that prefix
before putting options into NMDHCP4Config.
Signed-off-by: Jiří Klimeš <jklimes@redhat.com>
---
src/nm-policy.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/nm-policy.c b/src/nm-policy.c
index 02292f7..5c4059e 100644
--- a/src/nm-policy.c
+++ b/src/nm-policy.c
@@ -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) {
--
1.7.6.4