diff --git a/NetworkManager.spec b/NetworkManager.spec index d390af8..8b643ec 100644 --- a/NetworkManager.spec +++ b/NetworkManager.spec @@ -18,7 +18,7 @@ Name: NetworkManager Summary: Network connection manager and user applications Epoch: 1 Version: 0.7.1 -Release: 3%{snapshot}%{?dist} +Release: 4%{snapshot}%{?dist} Group: System Environment/Base License: GPLv2+ URL: http://www.gnome.org/projects/NetworkManager/ @@ -29,6 +29,7 @@ Source2: nm-system-settings.conf Patch1: nm-applet-internal-buildfixes.patch Patch2: explain-dns1-dns2.patch Patch3: ifcfg-rh-inotify-update-fix.patch +Patch4: nm-save-the-leases.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) PreReq: chkconfig @@ -148,6 +149,7 @@ tar -xjf %{SOURCE1} %patch1 -p1 -b .buildfix %patch2 -p1 -b .explain-dns1-dns2 %patch3 -p1 -b .ifcfg-rh-inotify-fix +%patch4 -p1 -b .per-connection-leases %build @@ -328,6 +330,10 @@ fi %{_datadir}/gtk-doc/html/libnm-util/* %changelog +* Tue May 05 2009 Adam Jackson 1:0.7.1-4.git20090414 +- nm-save-the-leases.patch: Use per-connection lease files, and don't delete + them on interface deactivate. + * Thu Apr 16 2009 Dan Williams - 1:0.7.1-3.git20090414 - ifcfg-rh: fix problems noticing changes via inotify (rh #495884) diff --git a/nm-save-the-leases.patch b/nm-save-the-leases.patch new file mode 100644 index 0000000..db5b7a5 --- /dev/null +++ b/nm-save-the-leases.patch @@ -0,0 +1,149 @@ +756bc704029050af94ef678bb4c0bdc02da14034 from upstream, corrected for +whitespace changes. + +diff -up NetworkManager-0.7.1/src/dhcp-manager/nm-dhcp-dhclient.c.jx NetworkManager-0.7.1/src/dhcp-manager/nm-dhcp-dhclient.c +--- NetworkManager-0.7.1/src/dhcp-manager/nm-dhcp-dhclient.c.jx 2009-04-14 18:48:02.000000000 -0400 ++++ NetworkManager-0.7.1/src/dhcp-manager/nm-dhcp-dhclient.c 2009-05-05 11:09:21.000000000 -0400 +@@ -61,11 +61,12 @@ get_pidfile_for_iface (const char * ifac + + + static char * +-get_leasefile_for_iface (const char * iface) ++get_leasefile_for_iface (const char * iface, const char *uuid) + { +- return g_strdup_printf ("%s/%s-%s.%s", ++ return g_strdup_printf ("%s/%s-%s-%s.%s", + NM_DHCP_MANAGER_LEASE_DIR, + NM_DHCP_MANAGER_LEASE_FILENAME, ++ uuid, + iface, + NM_DHCP_MANAGER_LEASE_FILE_EXT); + } +@@ -216,7 +217,9 @@ dhclient_child_setup (gpointer user_data + + + GPid +-nm_dhcp_client_start (NMDHCPDevice *device, NMSettingIP4Config *s_ip4) ++nm_dhcp_client_start (NMDHCPDevice *device, ++ const char *uuid, ++ NMSettingIP4Config *s_ip4) + { + GPtrArray *dhclient_argv = NULL; + GPid pid = 0; +@@ -234,7 +237,7 @@ nm_dhcp_client_start (NMDHCPDevice *devi + goto out; + } + +- device->lease_file = get_leasefile_for_iface (device->iface); ++ device->lease_file = get_leasefile_for_iface (device->iface, uuid); + if (!device->lease_file) { + nm_warning ("%s: not enough memory for dhclient options.", device->iface); + goto out; +diff -up NetworkManager-0.7.1/src/dhcp-manager/nm-dhcp-dhcpcd.c.jx NetworkManager-0.7.1/src/dhcp-manager/nm-dhcp-dhcpcd.c +--- NetworkManager-0.7.1/src/dhcp-manager/nm-dhcp-dhcpcd.c.jx 2009-03-03 11:55:47.000000000 -0500 ++++ NetworkManager-0.7.1/src/dhcp-manager/nm-dhcp-dhcpcd.c 2009-05-05 11:09:21.000000000 -0400 +@@ -60,7 +60,9 @@ dhcpcd_child_setup (gpointer user_data G + + + GPid +-nm_dhcp_client_start (NMDHCPDevice *device, NMSettingIP4Config *s_ip4) ++nm_dhcp_client_start (NMDHCPDevice *device, ++ const char *uuid, ++ NMSettingIP4Config *s_ip4) + { + GPtrArray *argv = NULL; + GPid pid = 0; +diff -up NetworkManager-0.7.1/src/dhcp-manager/nm-dhcp-manager.c.jx NetworkManager-0.7.1/src/dhcp-manager/nm-dhcp-manager.c +--- NetworkManager-0.7.1/src/dhcp-manager/nm-dhcp-manager.c.jx 2009-04-14 18:48:02.000000000 -0400 ++++ NetworkManager-0.7.1/src/dhcp-manager/nm-dhcp-manager.c 2009-05-05 11:10:46.000000000 -0400 +@@ -577,6 +577,7 @@ static void dhcp_watch_cb (GPid pid, gin + gboolean + nm_dhcp_manager_begin_transaction (NMDHCPManager *manager, + const char *iface, ++ const char *uuid, + NMSettingIP4Config *s_ip4, + guint32 timeout) + { +@@ -599,7 +600,7 @@ nm_dhcp_manager_begin_transaction (NMDHC + + nm_info ("Activation (%s) Beginning DHCP transaction.", iface); + +- device->pid = nm_dhcp_client_start (device, s_ip4); ++ device->pid = nm_dhcp_client_start (device, uuid, s_ip4); + if (device->pid == 0) + return FALSE; + +@@ -681,9 +682,8 @@ nm_dhcp_manager_cancel_transaction_real + device->pid_file = NULL; + } + +- /* Clean up the leasefile if it got left around */ ++ /* Free leasefile (but don't delete) */ + if (device->lease_file) { +- remove (device->lease_file); + g_free (device->lease_file); + device->lease_file = NULL; + } +diff -up NetworkManager-0.7.1/src/dhcp-manager/nm-dhcp-manager.h.jx NetworkManager-0.7.1/src/dhcp-manager/nm-dhcp-manager.h +--- NetworkManager-0.7.1/src/dhcp-manager/nm-dhcp-manager.h.jx 2009-04-14 18:48:02.000000000 -0400 ++++ NetworkManager-0.7.1/src/dhcp-manager/nm-dhcp-manager.h 2009-05-05 11:11:07.000000000 -0400 +@@ -89,6 +89,7 @@ GType nm_dhcp_manager_get_type (void); + NMDHCPManager *nm_dhcp_manager_get (void); + gboolean nm_dhcp_manager_begin_transaction (NMDHCPManager *manager, + const char *iface, ++ const char *uuid, + NMSettingIP4Config *s_ip4, + guint32 timeout); + void nm_dhcp_manager_cancel_transaction (NMDHCPManager *manager, +@@ -102,7 +103,9 @@ gboolean nm_dhcp_manager_foreach_d + gpointer user_data); + + /* The following are implemented by the DHCP client backends */ +-GPid nm_dhcp_client_start (NMDHCPDevice *device, NMSettingIP4Config *s_ip4); ++GPid nm_dhcp_client_start (NMDHCPDevice *device, ++ const char *uuid, ++ NMSettingIP4Config *s_ip4); + void nm_dhcp_client_stop (NMDHCPDevice *device, pid_t pid); + + gboolean nm_dhcp_client_process_classless_routes (GHashTable *options, +diff -up NetworkManager-0.7.1/src/nm-device.c.jx NetworkManager-0.7.1/src/nm-device.c +--- NetworkManager-0.7.1/src/nm-device.c.jx 2009-04-14 06:50:18.000000000 -0400 ++++ NetworkManager-0.7.1/src/nm-device.c 2009-05-05 11:09:21.000000000 -0400 +@@ -862,10 +862,12 @@ aipd_exec (NMDevice *self, GError **erro + static NMActStageReturn + real_act_stage3_ip_config_start (NMDevice *self, NMDeviceStateReason *reason) + { ++ NMConnection *connection; ++ NMSettingConnection *s_con; + NMSettingIP4Config *s_ip4; + NMActRequest *req; + NMActStageReturn ret = NM_ACT_STAGE_RETURN_SUCCESS; +- const char *ip_iface, *method = NULL; ++ const char *ip_iface, *method = NULL, *uuid; + + g_return_val_if_fail (reason != NULL, NM_ACT_STAGE_RETURN_FAILURE); + +@@ -873,8 +875,12 @@ real_act_stage3_ip_config_start (NMDevic + ip_iface = nm_device_get_ip_iface (self); + + req = nm_device_get_act_request (self); +- s_ip4 = (NMSettingIP4Config *) nm_connection_get_setting (nm_act_request_get_connection (req), +- NM_TYPE_SETTING_IP4_CONFIG); ++ connection = nm_act_request_get_connection (req); ++ s_con = (NMSettingConnection *) nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION); ++ g_assert (s_con); ++ uuid = nm_setting_connection_get_uuid (s_con); ++ ++ s_ip4 = (NMSettingIP4Config *) nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG); + + /* If we did not receive IP4 configuration information, default to DHCP */ + if (s_ip4) +@@ -890,7 +896,7 @@ real_act_stage3_ip_config_start (NMDevic + /* DHCP manager will cancel any transaction already in progress and we do not + want to cancel this activation if we get "down" state from that. */ + g_signal_handler_block (priv->dhcp_manager, priv->dhcp_state_sigid); +- success = nm_dhcp_manager_begin_transaction (priv->dhcp_manager, ip_iface, s_ip4, 45); ++ success = nm_dhcp_manager_begin_transaction (priv->dhcp_manager, ip_iface, uuid, s_ip4, 45); + g_signal_handler_unblock (priv->dhcp_manager, priv->dhcp_state_sigid); + + if (success) {