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 700300 - Ethernet device automatically switches back to active when calling org.freedesktop.NetworkManager.DeactivateConnection()
Ethernet device automatically switches back to active when calling org.freede...
Status: RESOLVED FIXED
Product: gnome-control-center
Classification: Core
Component: Network
git master
Other Linux
: Normal normal
: ---
Assigned To: Control-Center Maintainers
Control-Center Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-05-14 14:04 UTC by Lionel Landwerlin
Modified: 2013-05-15 14:44 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Control center dbus-monitor traces (11.65 KB, text/plain)
2013-05-14 14:04 UTC, Lionel Landwerlin
  Details
Shell dbus-monitor traces (3.15 KB, text/plain)
2013-05-14 14:05 UTC, Lionel Landwerlin
  Details
network: prevent ethernet device to switch back to 'on' state (1.29 KB, patch)
2013-05-14 18:48 UTC, Lionel Landwerlin
committed Details | Review

Description Lionel Landwerlin 2013-05-14 14:04:20 UTC
When you try to switch the ethernet connection off from the control center, it automatically switches back to active.
Though when you do the same thing from the Gnome-Shell, it works well.

Apparently the difference is that the control center uses org.freedesktop.NetworkManager.DeactivateConnection() where the Shell uses org.freedesktop.NetworkManager.Device.Disconnect().

Attached the dbus-monitor --system traces for each case.
Comment 1 Lionel Landwerlin 2013-05-14 14:04:49 UTC
Created attachment 244180 [details]
Control center dbus-monitor traces
Comment 2 Lionel Landwerlin 2013-05-14 14:05:09 UTC
Created attachment 244181 [details]
Shell dbus-monitor traces
Comment 3 Dan Williams 2013-05-14 17:14:49 UTC
Yes, DeactivateConnection() simply stops the connection and then the normal auto-activation checks happen again, which may cause the same connection to be activated again if that connection is set to autoconnect.

Device.Disconnect() will do the same thing, but disable autoconnect on the device until the user manually starts a new connection or the system goes through a suspend/resume cycle.

This has been documented in the NM D-Bus API docs for quite a while.  Perhaps the control-center should be using Disconnect() instead?
Comment 4 Lionel Landwerlin 2013-05-14 17:17:22 UTC
Roger that, will patch the control center.
Thanks for the quick response.
Comment 5 Lionel Landwerlin 2013-05-14 18:48:53 UTC
Created attachment 244229 [details] [review]
network: prevent ethernet device to switch back to 'on' state

Strange though, this problem doesn't happen with wifi.
Comment 6 Bastien Nocera 2013-05-15 10:41:42 UTC
Review of attachment 244229 [details] [review]:

Looks good for gnome-3-8 and master.
Comment 7 Lionel Landwerlin 2013-05-15 11:05:26 UTC
Comment on attachment 244229 [details] [review]
network: prevent ethernet device to switch back to 'on' state

Committed to 3.8 and master.
Comment 8 Pavel Simerda 2013-05-15 14:23:50 UTC
(In reply to comment #3)
> Yes, DeactivateConnection() simply stops the connection and then the normal
> auto-activation checks happen again, which may cause the same connection to be
> activated again if that connection is set to autoconnect.

Some time agoi I pointed out that we should probably handle connection the same way and mark them as manually disconnected, as we do with devices. Reopening to allow discussion of this possibility. I will get back to it as right now I don't remember the specific reason that brought me to this conclusion.
Comment 9 Bastien Nocera 2013-05-15 14:33:47 UTC
This particular bug is fixed though. File a new one when it comes back to you :)
Comment 10 Pavel Simerda 2013-05-15 14:44:50 UTC
(In reply to comment #9)
> This particular bug is fixed though. File a new one when it comes back to you
> :)

Sorry, didn't realize it was filed for the control center. Thanks for correction. Will reopen one on NetworkManager later with more information.