Fix setting hostname from DHCP options (rh #719100)

This commit is contained in:
Jiří Klimeš 2011-10-21 10:38:10 +02:00
parent 06db800a5c
commit 38ea3e9999
2 changed files with 50 additions and 1 deletions

View File

@ -15,7 +15,7 @@ Name: NetworkManager
Summary: Network connection manager and user applications
Epoch: 1
Version: 0.9.1.90
Release: 3%{snapshot}%{?dist}
Release: 4%{snapshot}%{?dist}
Group: System Environment/Base
License: GPLv2+
URL: http://www.gnome.org/projects/NetworkManager/
@ -28,6 +28,7 @@ Patch2: explain-dns1-dns2.patch
Patch3: nm-applet-no-notifications.patch
Patch4: nm-polkit-permissive.patch
Patch5: nm-applet-wifi-dialog-ui-fixes.patch
Patch6: rh719100-dhcp-hostname-fix.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Requires(post): chkconfig
@ -190,6 +191,7 @@ tar -xjf %{SOURCE1}
%patch3 -p1 -b .no-notifications
%patch4 -p1 -b .polkit-permissive
%patch5 -p1 -b .applet-wifi-ui
%patch6 -p1 -b .dhcp-hostname
%build
@ -458,6 +460,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
%{_libdir}/libnm-gtk.so
%changelog
* Fri Oct 21 2011 Jiří Klimeš <jklimes@redhat.com> - 0.9.1.90-4.git20110927
- core: fix setting hostname from DHCP options (rh #719100)
* Tue Sep 27 2011 Dan Williams <dcbw@redhat.com> - 0.9.1.90-3.git20110927
- core: fix location of wifi.ui (rh #741448)

View File

@ -0,0 +1,44 @@
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