]> git.ipfire.org Git - thirdparty/strongswan.git/blobdiff - src/charon-nm/nm/nm_service.c
Remove redundant calls to set peer config after checking out IKE_SAs by config
[thirdparty/strongswan.git] / src / charon-nm / nm / nm_service.c
index 9aec3942e819dad9a533230b3e847813b610f399..2d93b2fae47ed684ffbcf36bd43eac20ee0a5cfb 100644 (file)
@@ -884,18 +884,13 @@ static gboolean connect_(NMVpnServicePlugin *plugin, NMConnection *connection,
         */
        ike_sa = charon->ike_sa_manager->checkout_by_config(charon->ike_sa_manager,
                                                                                                                peer_cfg);
+       peer_cfg->destroy(peer_cfg);
        if (!ike_sa)
        {
-               peer_cfg->destroy(peer_cfg);
                g_set_error(err, NM_VPN_PLUGIN_ERROR, NM_VPN_PLUGIN_ERROR_LAUNCH_FAILED,
                                        "IKE version not supported.");
                return FALSE;
        }
-       if (!ike_sa->get_peer_cfg(ike_sa))
-       {
-               ike_sa->set_peer_cfg(ike_sa, peer_cfg);
-       }
-       peer_cfg->destroy(peer_cfg);
 
        /**
         * Register listener, enable  initiate-failure-detection hooks