Possible nmwa_dbus_update_device_wireless_networks bug



About a week ago, I noticed in my office that hovering over the NMN icon would show a signal strength of 80% put the progress bar would show below 50%. The command 'iwlist eth1 scan' showed two AP's, one weak and one strong. The hover was showing the strong AP and the progress bar was showing the weak one because it apparently was first in the AP list. I produced a patch to the function nmwa_dbus_update_device_wireless_networks that would display the AP with the max strength in case there were multiple AP's with the same essid. Since CVS-2-22, I have noticed that this patch is not needed.

To understand this better I applied yet another patch (below). This deletes the code that eliminates duplicates and it prints out the AP list to syslog everytime the function nmwa_dbus_update_device_wireless_networks is called. Here is what I have observed.

1. When there are duplicate AP's in the list (same essid), they always have the same (max) strength. This is a new feature. Did you do it intentionally?

2. The function nmwa_dbus_update_device_wireless_networks gets called once before wireless device activation, twice during wireless device activation, and once immediately after wireless device activation, and then it is only called when the wireless ip address is renewed. I assumed that nmwa_dbus_update_device_wireless_networks would be called everytime a scan is done but that does not seem to be the case because I believe scans are done repeatedly after activation with an increasing time interval between scans. It would be useful to call nmwa_dbus_update_device_wireless_networks every time a scan is done because, as it is now, the information in the progress bar can get rather stall before it is updated when the ip address is renewed.
______________________________________________
--- NMWirelessAppletDbus.c_orig 2005-02-19 14:43:46.000000000 -0500
+++ NMWirelessAppletDbus.c      2005-02-22 00:08:51.989911560 -0500
@@ -29,6 +29,7 @@
#include <dbus/dbus-glib-lowlevel.h>
#include "NMWirelessAppletDbus.h"
#include "NMWirelessApplet.h"
+#include <syslog.h>

#define DBUS_NO_SERVICE_ERROR "org.freedesktop.DBus.Error.ServiceDoesNotExist"

@@ -1007,12 +1008,6 @@
* of access points, and there may be more than one that have the same ESSID. Filter
                        * them here.
                        */
-                       for (j = 0; j < i; j++)
- if ((found = (networks[j] && (strcmp (networks[i], networks[j]) == 0))))
-                                       break;
-                       if (found)
-                               continue;
-
                       net = wireless_network_new ();
                       /* FIXME: what if net == NULL? */
                       net->nm_name = g_strdup (networks[i]);
@@ -1022,6 +1017,7 @@
net->strength = nmwa_dbus_get_object_strength (applet, net->nm_name);

                       dev->networks = g_slist_append (dev->networks, net);
+syslog (LOG_INFO, "num_items is %d item %d essid is %s strength is %d\n", num_items, i, net->essid, net->strength);
               }
               dbus_free (name);
       }

--
Bill Moss
Professor, Mathematical Sciences
Clemson University




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]