mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-01 14:58:05 +02:00
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.
This commit is contained in:
parent
b2b73809c5
commit
639f2d4b05
1 changed files with 4 additions and 6 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue