GNOME Bugzilla – Bug 771324
When a tun device is removed, a DeviceAdded signal is sent
Last modified: 2016-09-16 14:39:14 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.
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.
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 */
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.
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.
lgtm
Applied: https://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=cdedd2b53e08acebb8abf21cf2a2d84ab440aaa0 https://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?h=nm-1-4&id=b0463880fc4ccc52fff1391dffb9c3b8b11686e5
And also to nm-1-2: https://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?h=nm-1-2&id=c173fc96396b9ee1978b75b8d14183589ee0d93c