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) {