2006-01-03 Dan Williams <dcbw@redhat.com>

* src/dhcp-manager/nm-dhcp-manager.c
		- Recognize activation cancellation when waiting for DHCP
			configuration from dhcdbd
		- Ignore non-dhcdbd messages

	* src/nm-device.c
		- (real_act_stage3_ip_config_start): return to correct behavior
			of letting the dhcp-manager notify us of failure or
			success rather than incorrectly doing that ourselves
		- (nm_device_activate_stage4_ip_config_get): deal with
			activation cancellation a bit earlier


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1253 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
Dan Williams 2006-01-03 18:18:05 +00:00
parent f1fad5ecd0
commit 1c5f300910
3 changed files with 37 additions and 1 deletions

View file

@ -1,3 +1,17 @@
2006-01-03 Dan Williams <dcbw@redhat.com>
* src/dhcp-manager/nm-dhcp-manager.c
- Recognize activation cancellation when waiting for DHCP
configuration from dhcdbd
- Ignore non-dhcdbd messages
* src/nm-device.c
- (real_act_stage3_ip_config_start): return to correct behavior
of letting the dhcp-manager notify us of failure or
success rather than incorrectly doing that ourselves
- (nm_device_activate_stage4_ip_config_get): deal with
activation cancellation a bit earlier
2006-01-03 Dan Williams <dcbw@redhat.com>
* src/nm-device-802-11-wireless.c

View file

@ -451,10 +451,13 @@ static gboolean get_ip4_string (NMDHCPManager *manager, NMDevice *dev, const cha
static gboolean nm_completion_dhcp_bound_test(int tries,
nm_completion_args args)
{
NMActRequest *req = args[0];
NMActRequest * req = args[0];
NMDevice * dev = args[1];
if (state_is_bound (nm_act_request_get_dhcp_state (req)))
return TRUE;
if (nm_device_activation_should_cancel (dev))
return TRUE;
return FALSE;
}
@ -493,8 +496,12 @@ NMIP4Config * nm_dhcp_manager_get_ip4_config (NMDHCPManager *manager, NMActReque
g_assert (dev);
args[0] = req;
args[1] = dev;
nm_wait_for_completion (30, G_USEC_PER_SEC / 10,
nm_completion_dhcp_bound_test, NULL, args);
if (nm_device_activation_should_cancel (dev))
return NULL;
if (!state_is_bound (nm_act_request_get_dhcp_state (req)))
{
nm_warning ("Tried to get IP4 Config for a device when dhcdbd wasn't in a BOUND state!");
@ -605,6 +612,9 @@ gboolean nm_dhcp_manager_process_signal (NMDHCPManager *manager, DBusMessage *me
return FALSE;
if (!(interface = dbus_message_get_interface (message)))
return FALSE;
/* Ignore non-DHCP related messages */
if (strncmp (interface, "com.redhat.dhcp", 15))
return FALSE;
#if 0
signature = dbus_message_get_signature (message);

View file

@ -827,6 +827,11 @@ real_act_stage3_ip_config_start (NMDevice *self,
/* Begin a DHCP transaction on the interface */
if (!nm_dhcp_manager_begin_transaction (data->dhcp_manager, req))
ret = NM_ACT_STAGE_RETURN_FAILURE;
/* DHCP devices will be notified by the DHCP manager when
* stuff happens.
*/
ret = NM_ACT_STAGE_RETURN_POSTPONE;
}
return ret;
@ -1012,6 +1017,13 @@ nm_device_activate_stage4_ip_config_get (NMActRequest *req)
}
ret = NM_DEVICE_GET_CLASS (self)->act_stage4_get_ip4_config (self, req, &ip4_config);
if (nm_device_activation_should_cancel (self))
{
nm_device_schedule_activation_handle_cancel (req);
goto out;
}
if (ret == NM_ACT_STAGE_RETURN_POSTPONE)
goto out;
else if (!ip4_config || (ret == NM_ACT_STAGE_RETURN_FAILURE))