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 771324 - When a tun device is removed, a DeviceAdded signal is sent
When a tun device is removed, a DeviceAdded signal is sent
Status: RESOLVED FIXED
Product: NetworkManager
Classification: Platform
Component: API
1.2.x
Other Linux
: Normal normal
: ---
Assigned To: NetworkManager maintainer(s)
NetworkManager maintainer(s)
Depends on:
Blocks: nm-review
 
 
Reported: 2016-09-12 20:48 UTC by Dennis Kaarsemaker
Modified: 2016-09-16 14:39 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Signal log (23.95 KB, text/plain)
2016-09-12 20:48 UTC, Dennis Kaarsemaker
  Details
[PATCH] manager: emit device-removed signal when a device unrealizes (2.27 KB, patch)
2016-09-14 12:44 UTC, Beniamino Galvani
none Details | Review
[PATCH v2] manager: emit device-removed signal when a device unrealizes (2.29 KB, patch)
2016-09-15 09:15 UTC, Beniamino Galvani
none Details | Review

Description Dennis Kaarsemaker 2016-09-12 20:48:57 UTC
Created attachment 335404 [details]
Signal log

If I shut down an openvpn connection (nmcli con down name-of-vpn-connection), I see a DeviceAdded signal fly by for the tun0 device, followed by a few PropertiesChanged events for the device.

This is quite unexpected, I am expecting a DeviceRemoved signal instead.

Full signal log of the signals seen after 'nmcli con down' attached.
Comment 1 Beniamino Galvani 2016-09-14 12:44:58 UTC
Created attachment 335513 [details] [review]
[PATCH] manager: emit device-removed signal when a device unrealizes

This happens also on master; the attached patch fixes the issue.
Comment 2 Thomas Haller 2016-09-14 12:49:43 UTC
Review of attachment 335513 [details] [review]:

::: src/nm-manager.c
@@ +6049,3 @@
 
+	/* D-Bus exported; emitted only for realized devices or when a device
+	 * becomes unrealized */

shouldn't it be:

	/* D-Bus exported; emitted only for realized devices when a device
	 * becomes unrealized or removed */
Comment 3 Dennis Kaarsemaker 2016-09-14 13:40:15 UTC
Hi Beniamino,

Thanks for the quick response! I can confirm that this patch fixes the issue, I tested it by applying it to the ubuntu sources for 1.2.2 and replacing the package installed on my system.
Comment 4 Beniamino Galvani 2016-09-15 09:15:57 UTC
Created attachment 335612 [details] [review]
[PATCH v2] manager: emit device-removed signal when a device unrealizes

(In reply to Thomas Haller from comment #2)
> Review of attachment 335513 [details] [review] [review]:
> 
> ::: src/nm-manager.c
> @@ +6049,3 @@
>  
> +	/* D-Bus exported; emitted only for realized devices or when a device
> +	 * becomes unrealized */
> 
> shouldn't it be:
> 
> 	/* D-Bus exported; emitted only for realized devices when a device
> 	 * becomes unrealized or removed */

Yes, fixed.
Comment 5 Francesco Giudici 2016-09-16 14:18:24 UTC
lgtm