From b69f817d888b8515927b5c09fa2ddddd5c278cc6 Mon Sep 17 00:00:00 2001 From: Jiří Klimeš Date: Nov 20 2012 08:20:23 +0000 Subject: core: fix setting hostname returned from DHCP server (rh #875085) --- diff --git a/NetworkManager.spec b/NetworkManager.spec index 26f6332..c0926c9 100644 --- a/NetworkManager.spec +++ b/NetworkManager.spec @@ -21,7 +21,7 @@ Name: NetworkManager Summary: Network connection manager and user applications Epoch: 1 Version: 0.9.6.4 -Release: 2%{snapshot}%{?dist} +Release: 3%{snapshot}%{?dist} Group: System Environment/Base License: GPLv2+ URL: http://www.gnome.org/projects/NetworkManager/ @@ -36,6 +36,8 @@ Patch4: nm-polkit-permissive.patch Patch5: nm-applet-wifi-dialog-ui-fixes.patch Patch6: nss-error.patch Patch7: applet-ignore-deprecated.patch +Patch8: rh875085-set-hostname-from-dhcp.patch + BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Requires(post): chkconfig @@ -218,6 +220,7 @@ tar -xJf %{SOURCE1} %patch5 -p1 -b .applet-wifi-ui %patch6 -p1 -b .nss-error %patch7 -p1 -b .no-deprecated +%patch8 -p1 -b .dhcp-hostname %build @@ -506,6 +509,9 @@ glib-compile-schemas %{_datadir}/glib-2.0/schemas &>/dev/null || : %{_libdir}/libnm-gtk.so %changelog +* Wed Nov 20 2012 Jiří Klimeš - 0.9.6.4-3 +- core: fix setting hostname returned from DHCP server (rh #875085) + * Wed Nov 14 2012 Jiří Klimeš - 0.9.6.4-2 - spec: create /etc/NetworkManager/dnsmasq.d (rh #873621) diff --git a/rh875085-set-hostname-from-dhcp.patch b/rh875085-set-hostname-from-dhcp.patch new file mode 100644 index 0000000..735ce6e --- /dev/null +++ b/rh875085-set-hostname-from-dhcp.patch @@ -0,0 +1,35 @@ +From 1d8d4fd844a01203235a3bc21cff64924da6937a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= +Date: Wed, 14 Nov 2012 14:48:07 +0100 +Subject: [PATCH 1/2] policy: fix setting system hostname (rh #875085) +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Broken by commit 500315329765831d242d51d6a46f1e05869c15d2 +(core: move DNS change handling to the policy and optimize DNS updates (bgo #676778)) +It consolidated DNS update handling, but mistakenly removed hostname changing +from NM_DEVICE_STATE_ACTIVATED state handler. + +Signed-off-by: Jiří Klimeš +--- + src/nm-policy.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/src/nm-policy.c b/src/nm-policy.c +index c847586..a4ae4c7 100644 +--- a/src/nm-policy.c ++++ b/src/nm-policy.c +@@ -1440,6 +1440,9 @@ device_state_changed (NMDevice *device, + update_ip6_dns (policy, dns_mgr); + } + ++ /* Update hostname */ ++ update_system_hostname (policy, policy->default_device4, policy->default_device6); ++ + nm_dns_manager_end_updates (dns_mgr, __func__); + g_object_unref (dns_mgr); + +-- +1.7.11.7 +