2006-03-22 Robert Love <rml@novell.com>
* src/dhcp-manager/nm-dhcp-manager.c: Create NM_DHCP_TIMEOUT preprocessor define and use it instead of open-coded the DHCP timeout, which is currently 25 seconds, everywhere. git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1629 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
@@ -1,3 +1,9 @@
|
|||||||
|
2006-03-22 Robert Love <rml@novell.com>
|
||||||
|
|
||||||
|
* src/dhcp-manager/nm-dhcp-manager.c: Create NM_DHCP_TIMEOUT
|
||||||
|
preprocessor define and use it instead of open-coded the DHCP
|
||||||
|
timeout, which is currently 25 seconds, everywhere.
|
||||||
|
|
||||||
2006-03-22 Robert Love <rml@novell.com>
|
2006-03-22 Robert Love <rml@novell.com>
|
||||||
|
|
||||||
Implement "Dynamic WEP", which is basically WPA authentication and WEP
|
Implement "Dynamic WEP", which is basically WPA authentication and WEP
|
||||||
|
@@ -33,6 +33,8 @@
|
|||||||
#include "nm-utils.h"
|
#include "nm-utils.h"
|
||||||
|
|
||||||
|
|
||||||
|
#define NM_DHCP_TIMEOUT 25 /* DHCP timeout, in seconds */
|
||||||
|
|
||||||
struct NMDHCPManager
|
struct NMDHCPManager
|
||||||
{
|
{
|
||||||
NMData * data;
|
NMData * data;
|
||||||
@@ -172,7 +174,8 @@ static gboolean nm_dhcp_manager_handle_timeout (NMActRequest *req)
|
|||||||
dev = nm_act_request_get_dev (req);
|
dev = nm_act_request_get_dev (req);
|
||||||
g_assert (dev);
|
g_assert (dev);
|
||||||
|
|
||||||
nm_info ("Device '%s' DHCP transaction took too long (>25s), stopping it.", nm_device_get_iface (dev));
|
nm_info ("Device '%s' DHCP transaction took too long (>%ds), stopping it.",
|
||||||
|
nm_device_get_iface (dev), NM_DHCP_TIMEOUT);
|
||||||
|
|
||||||
if (nm_act_request_get_stage (req) == NM_ACT_STAGE_IP_CONFIG_START)
|
if (nm_act_request_get_stage (req) == NM_ACT_STAGE_IP_CONFIG_START)
|
||||||
{
|
{
|
||||||
@@ -238,8 +241,8 @@ gboolean nm_dhcp_manager_begin_transaction (NMDHCPManager *manager, NMActRequest
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set up a timeout on the transaction to kill it after 25s */
|
/* Set up a timeout on the transaction to kill it after NM_DHCP_TIMEOUT seconds */
|
||||||
source = g_timeout_source_new (25000);
|
source = g_timeout_source_new (NM_DHCP_TIMEOUT * 1000);
|
||||||
g_source_set_callback (source, (GSourceFunc) nm_dhcp_manager_handle_timeout, req, NULL);
|
g_source_set_callback (source, (GSourceFunc) nm_dhcp_manager_handle_timeout, req, NULL);
|
||||||
nm_act_request_set_dhcp_timeout (req, g_source_attach (source, manager->data->main_context));
|
nm_act_request_set_dhcp_timeout (req, g_source_attach (source, manager->data->main_context));
|
||||||
g_source_unref (source);
|
g_source_unref (source);
|
||||||
|
Reference in New Issue
Block a user