From 044ab2ee838ce1347b106c7198cf231f37512a0d Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 2 Mar 2006 22:25:43 +0000 Subject: [PATCH] 2006-03-02 Dan Williams * src/nm-device-802-11-wireless.c - (nm_device_802_11_wireless_set_scan_interval): don't scan-spam the card when it gets initialized. Since devices don't get added to the scan list until they are initialized, this function wasn't setting the intitial scan interval correctly, and was leaving it at 0. This caused cards to get many scan requests in a short amount of time when they were initialized git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1539 4912f4e0-d625-0410-9fb7-b9a5a253dbdc --- ChangeLog | 10 ++++++++++ src/nm-device-802-11-wireless.c | 13 +++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4fea1ad2a6..c1154f6987 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2006-03-02 Dan Williams + + * src/nm-device-802-11-wireless.c + - (nm_device_802_11_wireless_set_scan_interval): don't scan-spam the + card when it gets initialized. Since devices don't get added to + the scan list until they are initialized, this function wasn't + setting the intitial scan interval correctly, and was leaving + it at 0. This caused cards to get many scan requests in a short + amount of time when they were initialized + 2006-03-02 Robert Love * gnome/applet/applet.c: Do not set the pixbuf if we don't have an diff --git a/src/nm-device-802-11-wireless.c b/src/nm-device-802-11-wireless.c index ec0db79d85..7ba962ddab 100644 --- a/src/nm-device-802-11-wireless.c +++ b/src/nm-device-802-11-wireless.c @@ -852,6 +852,8 @@ nm_device_802_11_wireless_set_scan_interval (NMData *data, static guint source_id = 0; GSource * source = NULL; GSList * elt; + gboolean found = FALSE; + guint8 seconds = nm_wireless_scan_interval_to_seconds (interval); g_return_if_fail (data != NULL); @@ -866,12 +868,19 @@ nm_device_802_11_wireless_set_scan_interval (NMData *data, if (d && nm_device_is_802_11_wireless (d)) { - guint seconds = nm_wireless_scan_interval_to_seconds (interval); - NM_DEVICE_802_11_WIRELESS (d)->priv->scan_interval = seconds; + if (self && (NM_DEVICE (self) == d)) + found = TRUE; } } + /* In case the scan interval didn't get set (which can happen during card + * initialization where the device gets set up before being added to the + * device list), set interval here + */ + if (self && !found) + self->priv->scan_interval = seconds; + if (interval != NM_WIRELESS_SCAN_INTERVAL_INACTIVE) { source = g_timeout_source_new (120000);