Bug 280701 - Ad-hoc networks do not appear when they should or appear when they shouldn't
Summary: Ad-hoc networks do not appear when they should or appear when they shouldn't
Status: RESOLVED FIXED
Alias: None
Product: Network Management
Classification: Miscellaneous
Component: Wireless (show other bugs)
Version: 0.9
Platform: OpenSUSE Linux
: NOR normal (vote)
Target Milestone: ---
Assignee: Will Stephenson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-24 09:55 UTC by Tamás Németh
Modified: 2011-08-26 17:20 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
patch to fix some of the problems descript (8.53 KB, patch)
2011-08-24 15:53 UTC, Ilia Kats
Details
v2 (8.47 KB, patch)
2011-08-24 16:28 UTC, Ilia Kats
Details
v3 - fix crash when restarting NetworkManager (8.58 KB, patch)
2011-08-24 17:15 UTC, Ilia Kats
Details
v4 (3.22 KB, patch)
2011-08-24 17:37 UTC, Ilia Kats
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tamás Németh 2011-08-24 09:55:20 UTC
Version:           0.9 (using KDE 4.6.5) 
OS:                Linux

Besides that I'm entirely unable to connect to ad-hoc wireless networks (which may still be caused by the kernel, networkmanager or wpa_supplicant, can anyone do so?), there are several interesting problems:

-Adhoc connections appear on the list even when wireless networkin (or networking entirely) is disabled.

-Turning on the wireless network makes ad-hoc networks disappear :(

-They only reappear when I choose "show more" networks.

-The network management cannot realize that saved ad-hoc networks are the same as present ones, so SSIDs appear more than once.

Reproducible: Sometimes

Steps to Reproduce:
Create and ad-hoc network, and try to connect to it.

Actual Results:  
Ad-hoc networks appear and disappear in a way they shouldn't.

Expected Results:  
Ad-hoc networking (and networking in general!) should be antirely supported by KDE SC.
Comment 1 Lamarque V. Souza 2011-08-24 13:41:41 UTC
(In reply to comment #0)
> Version:           0.9 (using KDE 4.6.5) 
> OS:                Linux
> 
> Besides that I'm entirely unable to connect to ad-hoc wireless networks (which
> may still be caused by the kernel, networkmanager or wpa_supplicant, can anyone
> do so?), there are several interesting problems:
> 
> -Adhoc connections appear on the list even when wireless networkin (or
> networking entirely) is disabled.

I will fix that.
 
> -Turning on the wireless network makes ad-hoc networks disappear :(

That is intentional. Actually it is the untoggling of the "Show More button" that makes the ad-hoc networks disappear. When untoggled "Shore More" button should display only the most important networks of all types, not only wifi. Usually the most important networks are the ones the user has configured using Manage Connections, ad-hoc is an exception to this rule because most of the time the user is not interested in sharing the connection.
 
> -They only reappear when I choose "show more" networks.

Yes, that's right.
 
> -The network management cannot realize that saved ad-hoc networks are the same
> as present ones, so SSIDs appear more than once.

What do you mean by "as present ones"? The SSID should appear in the list only when one access point is using it, if it appears twice is probably because there is another computer using that same SSID, maybe the other end of the ad-hoc connection.
 
> Reproducible: Sometimes
> 
> Steps to Reproduce:
> Create and ad-hoc network, and try to connect to it.
> 
> Actual Results:  
> Ad-hoc networks appear and disappear in a way they shouldn't.
> 
> Expected Results:  
> Ad-hoc networking (and networking in general!) should be antirely supported by
> KDE SC.

Which feature is not supported? Anyway, most of the problems with ad-hoc wifi are in the drivers. And again: Plasma NM is not part of KDE SC.
Comment 2 Ilia Kats 2011-08-24 15:53:42 UTC
Created attachment 63119 [details]
patch to fix some of the problems descript

Hi,

could you please test the attached patch (against nm09 branch)? It should fix the duplicate SSID problem and the appearance of adhoc connections when WiFi is disabled. Also, it should now display adhoc networks, whose SSID is present in the environment, permanently, only to create an adhoc network you must toggle the Show More button.
Comment 3 Lamarque V. Souza 2011-08-24 16:13:36 UTC
(In reply to comment #2)
> Created an attachment (id=63119) [details]
> patch to fix some of the problems descript
> 
> Hi,
> 
> could you please test the attached patch (against nm09 branch)? It should fix
> the duplicate SSID problem and the appearance of adhoc connections when WiFi is
> disabled. Also, it should now display adhoc networks, whose SSID is present in
> the environment, permanently, only to create an adhoc network you must toggle
> the Show More button.

About the patch:

. You do not need to use qobject_cast in ActivatableListWidget::addWifiInterface.

. Ad-hoc connection appears in the environment in two cases: 1. after it has been activated in the computer or 2. when it has been activated in another computer. Your patch covers case #2 but not case #1.
Comment 4 Ilia Kats 2011-08-24 16:28:58 UTC
Created attachment 63120 [details]
v2

Removed the cast, sorry about that.

To what exactly are you referring by "the patch doesn't cover case 1"?
Comment 5 Lamarque V. Souza 2011-08-24 16:55:29 UTC
(In reply to comment #4)
> Created an attachment (id=63120) [details]
> v2
> 
> Removed the cast, sorry about that.
> 
> To what exactly are you referring by "the patch doesn't cover case 1"?

Shared connections, which are ad-hoc connections, are not listed by Solid::Control::WirelessNetworkInterfaceEnvironment until they are activated. It is kind of inconsistency showing ad-hoc networks from other computers but not the ones configured in the current computer (until they are also activated).

Maybe we should always display ad-hoc connection when wireless is enabled, that
would simplify things. The ActivatableListWidget::accept() method is too heavy and it is called several times when the "Show More" button is clicked. Your patch makes it even heavier.
Comment 6 Ilia Kats 2011-08-24 17:15:09 UTC
Created attachment 63122 [details]
v3 - fix crash when restarting NetworkManager

But we are only showing adhoc networks from other computers if there is a configured connection for them. Unconfigured adhoc networks are still only displayed if Show More is toggled.
Comment 7 Lamarque V. Souza 2011-08-24 17:26:45 UTC
(In reply to comment #6)
> Created an attachment (id=63122) [details]
> v3 - fix crash when restarting NetworkManager
> 
> But we are only showing adhoc networks from other computers if there is a
> configured connection for them. Unconfigured adhoc networks are still only
> displayed if Show More is toggled.

My point is that your patch is too heavy, it would be simplier if we threated ad-hoc connections as usual access points and not hide them by default. I do not see why someone would create more than one ad-hoc connection, they are used only  in shared connections. I prefer to always show ad-hoc connections instead of adding Solid::Control::WirelessNetworkInterfaceEnvironment to ActivatableListWidget.
Comment 8 Ilia Kats 2011-08-24 17:37:16 UTC
Created attachment 63124 [details]
v4
Comment 9 Lamarque V. Souza 2011-08-24 17:59:34 UTC
(In reply to comment #8)
> Created an attachment (id=63124) [details]
> v4

See how it is simpler :-) Tamás Németh, can you check if this patch fix your problems? If so then Ilia or me will commit it to the repository.
Comment 10 Lamarque V. Souza 2011-08-26 17:16:51 UTC
Git commit 445f4de059840e65eb5fe651ffeb4e0d333c78c5 by Lamarque V. Souza.
Committed on 26/08/2011 at 19:13.
Pushed by lvsouza into branch 'nm09'.

Treat ad-hoc connections as normal wifi connections in connection list.

BUG: 280701

M  +3    -8    libs/service/wirelessnetworkinterfaceactivatableprovider.cpp
M  +0    -9    applet/activatablelistwidget.cpp

http://commits.kde.org/networkmanagement/445f4de059840e65eb5fe651ffeb4e0d333c78c5
Comment 11 Lamarque V. Souza 2011-08-26 17:17:43 UTC
Reopen the bug if the reported problems still persist.
Comment 12 Lamarque V. Souza 2011-08-26 17:20:45 UTC
Git commit 5686b05e07e17c1dfe1d24a130f20eac91df4633 by Lamarque V. Souza.
Committed on 26/08/2011 at 19:13.
Pushed by lvsouza into branch 'master'.

Treat ad-hoc connections as normal wifi connections in connection list.

BUG: 280701

M  +3    -8    libs/service/wirelessnetworkinterfaceactivatableprovider.cpp
M  +0    -9    applet/activatablelistwidget.cpp

http://commits.kde.org/networkmanagement/5686b05e07e17c1dfe1d24a130f20eac91df4633