2008-04-21 Dan Williams <dcbw@redhat.com>

* src/nm-activation-request.c
	  src/nm-activation-request.h
		- (dispose): ensure to disconnect from the device's state-changed signal
			when appropriate so the signal doesn't get handled by an already
			disposed NMActRequest
		- (device_state_changed): update is_default here too just to make sure
			default is only True when the child device is activated
		- (nm_act_request_set_default): new function

	* src/NetworkManagerPolicy.c
		- (update_routing_and_dns): set 'default' on the active connection which
			has the default route and DNS



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3584 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
Dan Williams
2008-04-22 02:40:47 +00:00
parent d74967e1b6
commit 095da180c8
4 changed files with 55 additions and 0 deletions

View File

@@ -116,6 +116,7 @@ update_routing_and_dns (NMPolicy *policy, gboolean force_update)
{
NMDevice *best = NULL;
guint32 best_prio = 0;
NMActRequest *best_req = NULL;
GSList *devices, *iter;
NMNamedManager *named_mgr;
NMIP4Config *config;
@@ -146,6 +147,7 @@ update_routing_and_dns (NMPolicy *policy, gboolean force_update)
if (prio > best_prio) {
best = dev;
best_prio = prio;
best_req = req;
}
}
@@ -155,6 +157,16 @@ update_routing_and_dns (NMPolicy *policy, gboolean force_update)
goto out;
update_default_route (policy, best);
/* Update the default active connection */
for (iter = devices; iter; iter = g_slist_next (iter)) {
NMDevice *dev = NM_DEVICE (iter->data);
NMActRequest *req;
req = nm_device_get_act_request (dev);
if (req)
nm_act_request_set_default (req, (req == best_req) ? TRUE : FALSE);
}
named_mgr = nm_named_manager_get ();
config = nm_device_get_ip4_config (best);