2007-10-29 Dan Williams <dcbw@redhat.com>

* src/nm-hal-manager.c
		- (device_added, device_new_capability): ignore device additions while
			asleep.  Fixes crash caused when NM goes to sleep, a network device
			kernel module is unloaded and reloaded and recognized by NM again.



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3053 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
Dan Williams 2007-10-29 15:34:04 +00:00
parent 89e6709b20
commit 45759d66fa
2 changed files with 19 additions and 0 deletions

View file

@ -1,3 +1,10 @@
2007-10-29 Dan Williams <dcbw@redhat.com>
* src/nm-hal-manager.c
- (device_added, device_new_capability): ignore device additions while
asleep. Fixes crash caused when NM goes to sleep, a network device
kernel module is unloaded and reloaded and recognized by NM again.
2007-10-26 Dan Williams <dcbw@redhat.com>
Patch from Helmut Schaa <hschaa@suse.de> (and more bits from me)

View file

@ -236,6 +236,12 @@ device_added (LibHalContext *ctx, const char *udi)
// nm_debug ("New device added (hal udi is '%s').", udi );
/* Ignore device additions while asleep, all devices will
* be found and set up again on wake.
*/
if (nm_manager_get_state (manager->nm_manager) == NM_STATE_ASLEEP)
return;
/* Sometimes the device's properties (like net.interface) are not set up yet,
* so this call will fail, and it will actually be added when hal sets the device's
* capabilities a bit later on.
@ -265,6 +271,12 @@ device_new_capability (LibHalContext *ctx, const char *udi, const char *capabili
/*nm_debug ("nm_hal_device_new_capability() called with udi = %s, capability = %s", udi, capability );*/
/* Ignore device additions while asleep, all devices will
* be found and set up again on wake.
*/
if (nm_manager_get_state (manager->nm_manager) == NM_STATE_ASLEEP)
return;
creator_fn = get_creator (manager, udi);
if (creator_fn)
create_device_and_add_to_list (manager, creator_fn, udi);