]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
charon-nm: Mark VPN connection as persistent
authorTobias Brunner <tobias@strongswan.org>
Thu, 20 Mar 2025 08:26:33 +0000 (09:26 +0100)
committerTobias Brunner <tobias@strongswan.org>
Mon, 14 Apr 2025 09:40:59 +0000 (11:40 +0200)
If this is not set, it looks like NM shuts down the VPN connection and
calls disconnect() if there is any connectivity change.

References strongswan/strongswan#2707

src/charon-nm/nm/nm_service.c

index b920d5857f729064f2633bd722cedb4cc413e294..7c010dae2193470352e666345d6315edbb68a660 100644 (file)
@@ -214,6 +214,10 @@ static void signal_ip_config(NMVpnServicePlugin *plugin,
 
        handler = priv->handler;
 
+       /* we can reconnect automatically if interfaces change */
+       g_variant_builder_add (&builder, "{sv}", NM_VPN_PLUGIN_CAN_PERSIST,
+                                                  g_variant_new_boolean (TRUE));
+
        /* NM apparently requires to know the gateway (it uses it to install a
         * direct route via physical interface if conflicting routes are passed) */
        other = ike_sa->get_other_host(ike_sa);