2004-09-11 Dan Williams <dcbw@redhat.com>

* src/NetworkManager.c
		- Fix race condition between initscripts and NM on card insertion
			which could cause a card to keep an IP address and routes around
			even when it was not the active device

	* src/NetworkManagerDbus.c
		- Fix compile errors, free more DBusErrors


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@154 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
Dan Williams
2004-09-12 15:39:05 +00:00
parent 71919da4bf
commit 53e50a9c7e
3 changed files with 28 additions and 4 deletions

View File

@@ -1,3 +1,13 @@
2004-09-11 Dan Williams <dcbw@redhat.com>
* src/NetworkManager.c
- Fix race condition between initscripts and NM on card insertion
which could cause a card to keep an IP address and routes around
even when it was not the active device
* src/NetworkManagerDbus.c
- Fix compile errors, free more DBusErrors
2004-09-11 Dan Williams <dcbw@redhat.com>
* docs/NetworkManager DBUS API.txt

View File

@@ -372,6 +372,18 @@ gboolean nm_link_state_monitor (gpointer user_data)
*/
nm_device_update_ip4_address (dev);
}
else
{
/* Ensure that the device has no IP address or routes. This will
* sometimes occur when a card gets inserted, and the system
* initscripts will run to bring the card up, but they get around to
* running _after_ we've been notified of insertion and cleared out
* card info already.
*/
nm_system_device_flush_routes (dev);
if (nm_device_get_ip4_address (dev) != 0)
nm_system_device_flush_addresses (dev);
}
}
element = g_slist_next (element);

View File

@@ -1396,11 +1396,11 @@ DBusConnection *nm_dbus_init (NMData *data)
dbus_error_init (&dbus_error);
connection = dbus_bus_get (DBUS_BUS_SYSTEM, &dbus_error);
if ((connection == NULL) || dbus_error_is_set (&error))
if ((connection == NULL) || dbus_error_is_set (&dbus_error))
{
syslog (LOG_ERR, "nm_dbus_init() could not get the system bus. Make sure the message bus daemon is running?");
if (dbus_error_is_set (&error))
dbus_error_free (&error);
if (dbus_error_is_set (&dbus_error))
dbus_error_free (&dbus_error);
return (NULL);
}
@@ -1430,18 +1430,20 @@ DBusConnection *nm_dbus_init (NMData *data)
"sender='" NMI_DBUS_SERVICE "',"
"path='" NMI_DBUS_PATH "'",
&dbus_error);
dbus_error_free (&dbus_error);
dbus_bus_add_match(connection,
"type='signal',"
"interface='" DBUS_INTERFACE_ORG_FREEDESKTOP_DBUS "',"
"sender='" DBUS_SERVICE_ORG_FREEDESKTOP_DBUS "'",
&dbus_error);
dbus_error_free (&dbus_error);
dbus_bus_acquire_service (connection, NM_DBUS_SERVICE, 0, &dbus_error);
if (dbus_error_is_set (&dbus_error))
{
syslog (LOG_ERR, "nm_dbus_init() could not acquire its service. dbus_bus_acquire_service() says: '%s'", dbus_error.message);
dbus_error_free (&error);
dbus_error_free (&dbus_error);
return (NULL);
}