GNOME Bugzilla – Bug 503518
netspeed applets defaults to dud device - can't change
Last modified: 2008-08-24 18:59:54 UTC
on ubuntu 7.10 netspeed applet keeps defaulting and changing to wmaster0 when really all my wireless happens on the ra0 device (ralink rt2500 device). everytime NetworkManager reconnects to the network it does this. I can't change to ra0 in the netspeed preferences. If I remove and reinstall, it works for a while, until NetworkManager reconnects everything then it goes to wmaster0 again. wmaster0 is a nothing device on my system.
Looks like http://bugs.debian.org/461373
wmaster0 should be added to the list of ignored devices. looking at the debian bug report there might also be another issue. netspeed will not really always monitor the device with the default route, it only changes devices when a device is reported as down, and then will prefer devices with a default route. but if he default route changes without the current device going down, it will keep on watching the current one. i currently see no reason why it should not always monitor the device with the default route (if that option is enabled), other than excessive polling of /proc. but since that's probably what glibtop does internally to retrieve transferred bytes anyways, that should not be a strong counter-argument.
(In reply to comment #2) > wmaster0 should be added to the list of ignored devices. Is there anything like a list of ignored devices somewhere in the source code? I cannot find any.
still broken in Ubuntu Hardy Heron/Gnome 2.22.1
Since I install vmware with specific ipaddress, I only have vmnet8 and cannot change it. :~$ route -n Table de routage IP du noyau Destination Passerelle Genmask Indic Metric Ref Use Iface 192.168.112.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 172.16.138.0 0.0.0.0 255.255.255.0 U 0 0 0 vmnet8 172.16.74.0 0.0.0.0 255.255.255.0 U 0 0 0 vmnet1 0.0.0.0 192.168.112.1 0.0.0.0 UG 0 0 0 eth0 :~$ ifconfig -a eth0 Link encap:Ethernet HWaddr 00:13:72:6d:a9:67 inet adr:192.168.112.202 Bcast:192.168.112.255 Masque:255.255.255.0 adr inet6: fe80::213:72ff:fe6d:a967/64 Scope:Lien UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 Packets reçus:282 erreurs:0 :0 overruns:0 frame:0 TX packets:309 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 lg file transmission:1000 Octets reçus:107636 (105.1 KB) Octets transmis:41913 (40.9 KB) Interruption:16 lo Link encap:Boucle locale inet adr:127.0.0.1 Masque:255.0.0.0 adr inet6: ::1/128 Scope:Hôte UP LOOPBACK RUNNING MTU:16436 Metric:1 Packets reçus:29088 erreurs:0 :0 overruns:0 frame:0 TX packets:29088 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 lg file transmission:0 Octets reçus:20698639 (19.7 MB) Octets transmis:20698639 (19.7 MB) vmnet1 Link encap:Ethernet HWaddr 00:50:56:c0:00:01 inet adr:172.16.74.1 Bcast:172.16.74.255 Masque:255.255.255.0 adr inet6: fe80::250:56ff:fec0:1/64 Scope:Lien UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 Packets reçus:0 erreurs:0 :0 overruns:0 frame:0 TX packets:131 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 lg file transmission:1000 Octets reçus:0 (0.0 B) Octets transmis:0 (0.0 B) vmnet8 Link encap:Ethernet HWaddr 00:50:56:c0:00:08 inet adr:172.16.138.1 Bcast:172.16.138.255 Masque:255.255.255.0 adr inet6: fe80::250:56ff:fec0:8/64 Scope:Lien UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 Packets reçus:0 erreurs:0 :0 overruns:0 frame:0 TX packets:130 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 lg file transmission:1000 Octets reçus:0 (0.0 B) Octets transmis:0 (0.0 B) Before installing, it was not possible to modify the device, but I thought with only one it was normal... Thanks
if you uncheck "always monitor a connected device" then you can set the device manually
(In reply to comment #3) > (In reply to comment #2) > > wmaster0 should be added to the list of ignored devices. > > Is there anything like a list of ignored devices somewhere in the source code? > I cannot find any. > from backend.c: goolean is_no_dummy_device(const char* device) { return !g_str_has_prefix(device, "lo") && !g_str_has_prefix(device, "dummy"); } wmaster should be added there, and maybe vmnet... the real problem is however a) the wording of the "always monitor connected device" option, because its hard to understand what it means b) that enabling this option disables the combo. it should be the other way round
(In reply to comment #6) > if you uncheck "always monitor a connected device" then you can set the device > manually > Yes you can, but this is annoying if you frequently switch between e.g. wired and wireless network as I do. It is so much more comfortable when the active device is auto-detected.
(In reply to comment #8) > (In reply to comment #6) > > if you uncheck "always monitor a connected device" then you can set the device > > manually > > > > Yes you can, but this is annoying if you frequently switch between e.g. wired > and wireless network as I do. It is so much more comfortable when the active > device is auto-detected. True, that's the whole point of this option. As I said above, i think it should be turned into an "always monitor device with default route" mode. (Currently it will only automatically switch from a device to another when the device goes down; which will break in case it starts monitoring an always up, but uninteressting device like vmware0)
*** Bug 532294 has been marked as a duplicate of this bug. ***
Laptops with Intel wifi cards and using the iwl drivers that comes with the kernel also has the wmaster0 interface always showing as connected. I made the following changes to backend.c , compile and replace the one that came with Fedora and it works perfectly. Line 28: - return !g_str_has_prefix(device, "lo") && !g_str_has_prefix(device, "dummy"); + return !g_str_has_prefix(device, "lo") && !g_str_has_prefix(device, "dummy") && !g_str_has_prefix(device, "wmaster"); Now it will only monitor either eth0 or wlan0.
A couple of more possible interface names which at least I would like to be excluded: tap* (used for my VirtualBox networking) tun* (used by vpnc VPN client)
You can add any other devices to ignore by adding: && !g_str_has_prefix(device, "<devicetype>") for each device type. To ignore tap* and tun*, the line would read: return !g_str_has_prefix(device, "lo") && !g_str_has_prefix(device, "dummy") && !g_str_has_prefix(device, "wmaster") && !g_str_has_prefix(device, "tun") && !g_str_has_prefix(device, "tap");
Would it be possible add a list of devices that are currently connected (or listed on the system) and to be able to select to blacklist certain ones? My laptop keeps monitoring vmnet* and wlan* interfaces (which are not my main interfaces).
Hello everyone, I've commit this http://svn.gnome.org/viewvc/netspeed?view=revision&revision=123 and done little testing. Seems to be OK.
Benoît: your checkin fixes half of the problem. Now netspeed no longer gets stuck monitoring the useless wmaster0, but it still gets stuck monitoring the completely uninteresting vmnet8 (which has an assigned IP address in the local zone, so is not filtered out by your patch). I agree with Jörgen: netspeed should always poll /proc/net/dev and always monitor the device used for the default route. Maybe listening to Network Manager's D-Bus messages could remove the need for polling, but not everyone uses Network Manager. Maybe the best solution would be to re-check the default route every minute or so (to avoid excessive polling) and *also* listen for D-Bus messages from Network Manager (to immediately switch to monitoring the active device as soon as N-M goes online).
Created attachment 117283 [details] [review] patch to fix get_default_route() to correctly determine the default route I implemented more proactive polling of the default route and noticed that get_default_route() is buggy: it returns "vmnet8" on my system. Apparently get_default_route() thinks the first route without a gateway is the default, which is nonsense. The default route is the one with a netmask of /0.
Created attachment 117284 [details] [review] patch to make netspeed always follow the device with the default route And here's a patch that makes netspeed applet check the default route on every update and switch the device if the default route changes, even if the old device is still connected. Tested against netspeed-0.14 on Ubuntu Hardy. Works for me: switching from wifi to wlan is instant, switching from wlan to wifi briefly has netspeed monitoring vmnet8 until the wifi connection is completely established, when netspeed correctly switches over to eth1. Depends on the get_default_route fix I've just attached.
Thanks! :-) Committed.This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.