From eb13a05c2bb7a1c68b755f8b75d74e05364d09d6 Mon Sep 17 00:00:00 2001 From: Robert Love Date: Tue, 13 Jun 2006 19:54:22 +0000 Subject: [PATCH] 2006-06-13 Robert Love * gnome/applet/applet-dbus-info.c: Don't set the fallback bit to FALSE if it is currently set to TRUE. Otherwise, we will reset the value when we connect normally. * src/nm-device-802-11-wireless.c: For the roaming code, make sure that the old BSSID is valid, too. The recently added ESSID check may not be sufficient (we can remove it?). What we really want to catch is the case of going from all-zeros to the BSSID of some other network, which happens on failure. git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1823 4912f4e0-d625-0410-9fb7-b9a5a253dbdc --- ChangeLog | 11 +++++++++++ gnome/applet/applet-dbus-info.c | 20 +++++++++++++------- src/nm-device-802-11-wireless.c | 5 +++-- 3 files changed, 27 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 23bba0e971..a68319e282 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2006-06-13 Robert Love + + * gnome/applet/applet-dbus-info.c: Don't set the fallback bit to FALSE + if it is currently set to TRUE. Otherwise, we will reset the value + when we connect normally. + * src/nm-device-802-11-wireless.c: For the roaming code, make sure that + the old BSSID is valid, too. The recently added ESSID check may not be + sufficient (we can remove it?). What we really want to catch is the + case of going from all-zeros to the BSSID of some other network, which + happens on failure. + 2006-06-09 Dan Williams * src/NetworkManagerSystem.[ch] diff --git a/gnome/applet/applet-dbus-info.c b/gnome/applet/applet-dbus-info.c index 897e1b7f53..5a77aff3ec 100644 --- a/gnome/applet/applet-dbus-info.c +++ b/gnome/applet/applet-dbus-info.c @@ -822,11 +822,12 @@ nmi_save_network_info (NMApplet *applet, const char *bssid, NMGConfWSO * gconf_wso) { - char * key; - GConfEntry * gconf_entry; - char * escaped_network; - GnomeKeyringResult ret; - guint32 item_id; + char * key; + GConfEntry * gconf_entry; + char * escaped_network; + GnomeKeyringResult ret; + guint32 item_id; + GConfValue * value; g_return_if_fail (applet != NULL); g_return_if_fail (essid != NULL); @@ -857,13 +858,18 @@ nmi_save_network_info (NMApplet *applet, g_free (key); } + /* + * XXX: We don't want to move a network from fallback to non-fallback because the user + * connected via other means. We need a better way to do this. + */ key = g_strdup_printf ("%s/%s/fallback", GCONF_PATH_WIRELESS_NETWORKS, escaped_network); - gconf_client_set_bool (applet->gconf_client, key, fallback, NULL); + value = gconf_client_get (applet->gconf_client, key, NULL); + if (!value || value->type != GCONF_VALUE_BOOL || (!gconf_value_get_bool (value) && fallback)) + gconf_client_set_bool (applet->gconf_client, key, fallback, NULL); g_free (key); if (bssid && (strlen (bssid) >= 11)) { - GConfValue * value; GSList * new_bssid_list = NULL; gboolean found = FALSE; diff --git a/src/nm-device-802-11-wireless.c b/src/nm-device-802-11-wireless.c index d42bf1f287..1ac8e358e8 100644 --- a/src/nm-device-802-11-wireless.c +++ b/src/nm-device-802-11-wireless.c @@ -172,12 +172,13 @@ nm_device_802_11_wireless_update_bssid (NMDevice80211Wireless *self) return; /* Get the current BSSID. If it is valid but does not match the stored value, - * and the ESSID is the same as what we think its suposed to be, update it. */ + * and the ESSID is the same as what we think its supposed to be, update it. */ nm_device_802_11_wireless_get_bssid (self, &new_bssid); old_bssid = nm_ap_get_address (ap); new_essid = nm_device_802_11_wireless_get_essid(self); old_essid = nm_ap_get_essid(ap); if ( nm_ethernet_address_is_valid (&new_bssid) + && nm_ethernet_address_is_valid (old_bssid) && !nm_ethernet_addresses_are_equal (&new_bssid, old_bssid) && !nm_null_safe_strcmp (old_essid, new_essid)) { @@ -864,7 +865,7 @@ get_best_fallback_ap (NMDevice80211Wireless *self) if (best_ap) { nm_ap_set_broadcast (best_ap, FALSE); - nm_info ("No allowed networks in sight: Brute forcing fall-back '%s'", nm_ap_get_essid (best_ap)); + nm_info ("Attempting to fallback to wireless network '%s'", nm_ap_get_essid (best_ap)); } return best_ap;