After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 503518 - netspeed applets defaults to dud device - can't change
netspeed applets defaults to dud device - can't change
Status: RESOLVED FIXED
Product: netspeed
Classification: Deprecated
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Netspeed maintainers
Netspeed maintainers
: 532294 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2007-12-14 00:17 UTC by Wayne Schuller
Modified: 2008-08-24 18:59 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch to fix get_default_route() to correctly determine the default route (589 bytes, patch)
2008-08-24 00:15 UTC, Marius Gedminas
none Details | Review
patch to make netspeed always follow the device with the default route (999 bytes, patch)
2008-08-24 00:18 UTC, Marius Gedminas
none Details | Review

Description Wayne Schuller 2007-12-14 00:17:31 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.
Comment 1 Josselin Mouette 2008-01-21 09:33:01 UTC
Looks like http://bugs.debian.org/461373
Comment 2 Jörgen Scheibengruber 2008-02-17 14:30:00 UTC
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.
Comment 3 Johannes Rohr 2008-03-15 07:05:18 UTC
(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. 
Comment 4 Wayne Schuller 2008-04-29 22:17:09 UTC
still broken in Ubuntu Hardy Heron/Gnome 2.22.1
Comment 5 dominique 2008-05-07 17:50:46 UTC
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
Comment 6 Jörgen Scheibengruber 2008-05-07 19:01:24 UTC
if you uncheck "always monitor a connected device" then you can set the device manually
Comment 7 Jörgen Scheibengruber 2008-05-07 19:08:19 UTC
(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
Comment 8 Johannes Rohr 2008-05-08 10:29:20 UTC
(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.
Comment 9 Jörgen Scheibengruber 2008-05-08 20:02:04 UTC
(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)
Comment 10 Jörgen Scheibengruber 2008-05-09 17:59:40 UTC
*** Bug 532294 has been marked as a duplicate of this bug. ***
Comment 11 Ong Kian Hua 2008-05-12 14:20:51 UTC
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.
Comment 12 g11024342@trbvm.com 2008-05-12 14:29:01 UTC
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)


Comment 13 Ong Kian Hua 2008-05-14 13:55:18 UTC
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");

Comment 14 James Gregory 2008-05-20 10:46:45 UTC
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).
Comment 15 Benoît Dejean 2008-07-02 19:55:35 UTC
Hello everyone,

I've commit this http://svn.gnome.org/viewvc/netspeed?view=revision&revision=123 and done little testing. Seems to be OK.
Comment 16 Marius Gedminas 2008-08-23 22:41:04 UTC
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).
Comment 17 Marius Gedminas 2008-08-24 00:15:27 UTC
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.
Comment 18 Marius Gedminas 2008-08-24 00:18:05 UTC
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.
Comment 19 Jörgen Scheibengruber 2008-08-24 18:59:54 UTC
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.