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

* src/NetworkManagerPolicy.c
		- (nm_policy_device_change_check): don't autoswitch away from
			Ad-Hoc networks, since there's really no concept of "link"

	* src/nm-dbus-nm.c
		- (nm_dbus_nm_create_wireless_network): mark created networks
			as Ad-Hoc networks

	* src/nm-device-802-11-wireless.c
		- (real_activation_success_handler): add user-created Ad-Hoc
			networks to the device's scan list


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1300 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
Dan Williams
2006-01-09 05:11:29 +00:00
parent fb8c10a370
commit 5cac86fdd2
4 changed files with 34 additions and 6 deletions

View File

@@ -371,19 +371,24 @@ static gboolean nm_policy_device_change_check (NMData *data)
{
NMAccessPoint *old_ap = nm_act_request_get_ap (old_act_req);
const char * old_essid = nm_ap_get_essid (old_ap);
int old_mode = nm_ap_get_mode (old_ap);
const char * new_essid = nm_ap_get_essid (ap);
/* Schedule new activation if the currently associated access point is not the "best" one
* or we've lost the link to the old access point.
/* Schedule new activation if the currently associated
* access point is not the "best" one or we've lost the
* link to the old access point. We don't switch away
* from Ad-Hoc APs either.
*/
gboolean es = (strcmp (old_essid, new_essid) != 0);
gboolean same_essid = (strcmp (old_essid, new_essid) == 0);
gboolean link = nm_device_has_active_link (old_dev);
if (es || !link)
if ((!same_essid || !link) && (old_mode != IW_MODE_ADHOC))
{
nm_info ("SWITCH: found better connection '%s/%s' than current connection '%s/%s'. different_ssids=%d, have_link=%d",
nm_info ("SWITCH: found better connection '%s/%s'"
" than current connection '%s/%s'. "
"same_ssid=%d, have_link=%d",
nm_device_get_iface (new_dev), new_essid,
nm_device_get_iface (old_dev), old_essid,
es, link);
same_essid, link);
do_switch = TRUE;
}
} /* Always prefer Ethernet over wireless, unless the user explicitly switched away. */