Bug 298974

Summary: Сonnection, which is specified in the settings only eth1 (not any), must not appear in the list available to eth0.
Product: [Unmaintained] Network Management Reporter: Eugene <ken20001>
Component: Plasma WidgetAssignee: Sebastian Kügler <sebas>
Status: RESOLVED FIXED    
Severity: normal CC: dos, lamarque, sergio.callegari, wstephenson
Priority: NOR    
Version: 0.9   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In: 0.9.0.5
Sentry Crash Report:

Description Eugene 2012-04-28 12:18:57 UTC
Сonnection, which is specified in the settings only eth1 (not any), must not appear in the list available to eth0.

Reproducible: Always

Steps to Reproduce:
1. Left mouse button click on a widget.
2. Look into the Ethernet tab of connection and check that it set to eth1.
3. Look into the right panel of a widget (left mouse click in tray) displaying the amount of connections.
Actual Results:  
NM Widget displaying connection, which is specified in the settings only eth1 (not any), must not appear in the list available to eth0.

Expected Results:  
I expected to see only connections for the eth1.
Comment 1 Lamarque V. Souza 2012-05-06 02:54:21 UTC
For performance reason I am really not willing to implement this.
Comment 2 Eugene 2012-05-06 14:58:19 UTC
Could you explain why more clearly ? Thanks.
Comment 3 Lamarque V. Souza 2012-05-06 15:16:23 UTC
This is a rarely used feature and to implement it I need to change the algorithm that filter connections to include this new criteria, so it affects all connections. Besides, I plan to implement a new way to select what network interface to use to activate a connection and I rely on the fact that all possible connections are listed, not only the ones marked as "Restrict to interface".
Comment 4 Sebastian Krzyszkowiak 2012-08-12 17:15:54 UTC
I don't think this is "rarely used feature". Not having that implemented is really annoying when for instance connecting phone via USB which shows up as ethernet interface, which is quite common. And it shows dead elements in UI - restricted connections displayed in other interfaces just do nothing when clicked, which is serious UX bug.

Did I understand it correctly - you plan to change interface to show all available connections just once, and if they can be applied to many interfaces, ask user which one he wants to use after click?
Comment 5 Lamarque V. Souza 2012-08-12 18:44:35 UTC
(In reply to comment #4)
> I don't think this is "rarely used feature". Not having that implemented is
> really annoying when for instance connecting phone via USB which shows up as
> ethernet interface, which is quite common. And it shows dead elements in UI
> - restricted connections displayed in other interfaces just do nothing when
> clicked, which is serious UX bug.

That ethernet connection for phones is problem in ModemManager, it did not used to do that.
 
> Did I understand it correctly - you plan to change interface to show all
> available connections just once, and if they can be applied to many
> interfaces, ask user which one he wants to use after click?

yes, except that I want to implement drag'n drop to choose the network interface to activate the connection. If you just click on the connection it will automatically select the last one used.
Comment 6 Sebastian Krzyszkowiak 2012-08-12 18:49:53 UTC
(In reply to comment #5)
> (In reply to comment #4)
> > I don't think this is "rarely used feature". Not having that implemented is
> > really annoying when for instance connecting phone via USB which shows up as
> > ethernet interface, which is quite common. And it shows dead elements in UI
> > - restricted connections displayed in other interfaces just do nothing when
> > clicked, which is serious UX bug.
> 
> That ethernet connection for phones is problem in ModemManager, it did not
> used to do that.

Actually, no. I didn't mean phones reporting as modem for internet connection, I thought about phones reporting as ethernet device to allow connection between phone and PC - like Openmoko phones do or like PC Suite mode works in Nokia N900 (probably in other models too, but I'm not 100% sure).
Comment 7 Sebastian Krzyszkowiak 2012-08-12 22:21:50 UTC
Looking at code, it seems like almost everything needed for filtering out unmatching connections is already in place. 

Function:
bool NetworkInterfaceActivatableProvider::hardwareAddressMatches(Knm::Connection * connection, Solid::Control::NetworkInterfaceNm09 * iface)
is called on each connection, but it always returns true due to lack of proper handling of reading MAC address from configuration. Code is there, but seems to be from KNetworkManager era, comment says that probably it was working in wrong way and now it is disabled with "#if 0" and "#endif" instructions.

It's in libs/service/networkinterfaceactivatableprovider.cpp at line 151.

So to fix this issue with current UI one just needs to implement hardwareAddressMatches method.
Comment 8 Lamarque V. Souza 2012-08-13 02:53:25 UTC
*** Bug 301762 has been marked as a duplicate of this bug. ***
Comment 9 Sebastian Krzyszkowiak 2012-08-13 08:51:05 UTC
Is it really fixed? Two patches that I sent you few hours ago were for some different issue (displaying useless connections for unmanaged interfaces) and I can't find any other recent commit in git repo other than those two.
Comment 10 Sebastian Krzyszkowiak 2012-08-18 13:07:12 UTC
Just to keep track of bug for anyone interested: now it's really fixed in git.