summaryrefslogtreecommitdiff
path: root/src/devices
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2016-03-07 18:14:30 +0100
committerBeniamino Galvani <bgalvani@redhat.com>2016-03-07 18:22:12 +0100
commit639f2d4b05aa1704618a22baa9eababfe6bd557d (patch)
treee6ddb04cf04ff65c2ef776b3b706a94b217bc465 /src/devices
parentb2b73809c5e2e9422b4e19716284a8b969832a3e (diff)
downloadNetworkManager-639f2d4b05aa1704618a22baa9eababfe6bd557d.tar.gz
device: don't assert the presence of old vpn configurations
When a VPN connection is active and the parent device becomes unmanaged (due to device removal or system entering sleep), all configurations are removed from the interface and the device is taken down. After that, the VPN is disconnected and tries to remove the old VPN configuration from device, causing the following assertion to fail: _replace_vpn_config_in_list: assertion '!old' failed Remove the assertion as @old can be missing for valid reasons.
Diffstat (limited to 'src/devices')
-rw-r--r--src/devices/nm-device.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
index 4502cf5d3b..a25830ac04 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -7926,9 +7926,10 @@ _replace_vpn_config_in_list (GSList **plist, GObject *old, GObject *new)
{
GSList *old_link;
- /* Below, assert that we have an @old instance to replace and that
- * @new is not yet tracked. But still, behave correctly in any
- * case. */
+ /* Below, assert that @new is not yet tracked, but still behave
+ * correctly in any case. Don't complain for missing @old since
+ * it could have been removed when the parent device became
+ * unmanaged. */
if ( old
&& (old_link = g_slist_find (*plist, old))) {
@@ -7947,12 +7948,9 @@ _replace_vpn_config_in_list (GSList **plist, GObject *old, GObject *new)
*plist = g_slist_append (*plist, g_object_ref (new));
else
g_return_val_if_reached (TRUE);
- g_return_val_if_fail (!old, TRUE);
return TRUE;
}
- /* return FALSE if both @old and @new are unset. */
- g_return_val_if_fail (!old, FALSE);
return FALSE;
}