vpn: avoid calling call_plugin_disconnect() without proxy

Got an assertion due to priv-proxy unset.
  NMDevice:
    - _platform_link_cb_idle()
     - nm_device_unrealize() [NMDeviceTun]
      - nm_device_state_changed()
       - _set_state_full()
         NMVpnConnection:
           - _set_vpn_state()
            - call_plugin_disconnect()

It seam to me, that can only happen if the NMVpnConnection never
completed on_proxy_acquired() and is still in preparing state when
being disconnected.

Avoid that be checking whether we have a proxy.

https://bugzilla.redhat.com/show_bug.cgi?id=1442064
(cherry picked from commit bc1d1c9df4)
This commit is contained in:
Thomas Haller 2017-04-13 17:28:22 +02:00
parent 9029dabb87
commit e6b1a31106

View file

@ -646,7 +646,8 @@ _set_vpn_state (NMVpnConnection *self,
}
/* Tear down and clean up the connection */
call_plugin_disconnect (self);
if (priv->proxy)
call_plugin_disconnect (self);
vpn_cleanup (self, parent_dev);
/* fall through */
default: