Commit 5c9e06c35e for strongswan.org

commit 5c9e06c35e70df34ea386bed32362fcaf2d4856c
Author: Gary T. Giesen <ggiesen@giesen.me>
Date:   Mon Sep 7 20:26:45 2026 -0400

    charon-nm: Add a per-connection DPD delay

    `peer_cfg_create_t.dpd` is left zero-filled, so ike_sa.c never schedules
    a periodic liveness check for connections managed by the NM backend.
    Users might like to activate such checks to detect if a gateway disappears
    without sending a DELETE.

    This is not covered by `charon-nm.check_current_path`, which is enabled
    by default in charon-nm. That fires a single DPD from the roam handler
    after interfaces or addresses change, so it catches the client moving.
    It does not catch the gateway going away while the client sits still on
    an unchanged network, which is the common case for a laptop on a desk.

    Read the delay from a "dpd-delay" data item on the connection, parsed
    with `settings_value_as_time()` so both "30" and "30s" work. An unset
    item gives 0, which is the current behavior, so nothing changes for
    existing connections unless the delay is configured.

    Signed-off-by: Gary T. Giesen <ggiesen@giesen.me>

diff --git a/src/charon-nm/nm/nm_service.c b/src/charon-nm/nm/nm_service.c
index ad7b09c345..5b58c062ec 100644
--- a/src/charon-nm/nm/nm_service.c
+++ b/src/charon-nm/nm/nm_service.c
@@ -1005,6 +1005,8 @@ static gboolean connect_(NMVpnServicePlugin *plugin, NMConnection *connection,
 	ike.force_encap = streq(str, "yes");
 	str = nm_setting_vpn_get_data_item(vpn, "ipcomp");
 	child.options |= streq(str, "yes") ? OPT_IPCOMP : 0;
+	str = nm_setting_vpn_get_data_item(vpn, "dpd-delay");
+	peer.dpd = settings_value_as_time((char*)str, 0);

 	/**
 	 * Register credentials