Commit 639f2d4b authored by Beniamino Galvani's avatar Beniamino Galvani

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.
parent b2b73809
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment