[NetworkManager/f16] Fix setting hostname from DHCP options (rh #719100)

Jirka Klimes jklimes at fedoraproject.org
Fri Oct 21 08:41:58 UTC 2011


commit 38ea3e9999aff478d05f59c739bc593bc97e2791
Author: Jiří Klimeš <jklimes at redhat.com>
Date:   Fri Oct 21 10:38:10 2011 +0200

    Fix setting hostname from DHCP options (rh #719100)

 NetworkManager.spec              |    7 +++++-
 rh719100-dhcp-hostname-fix.patch |   44 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 50 insertions(+), 1 deletions(-)
---
diff --git a/NetworkManager.spec b/NetworkManager.spec
index 717edc2..9da7812 100644
--- a/NetworkManager.spec
+++ b/NetworkManager.spec
@@ -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 at redhat.com> - 0.9.1.90-4.git20110927
+- core: fix setting hostname from DHCP options (rh #719100)
+
 * Tue Sep 27 2011 Dan Williams <dcbw at redhat.com> - 0.9.1.90-3.git20110927
 - core: fix location of wifi.ui (rh #741448)
 
diff --git a/rh719100-dhcp-hostname-fix.patch b/rh719100-dhcp-hostname-fix.patch
new file mode 100644
index 0000000..0bc8fb8
--- /dev/null
+++ b/rh719100-dhcp-hostname-fix.patch
@@ -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 at 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 at 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
+


More information about the scm-commits mailing list