Skip to content

strongswan: Invalid dpd_action value 'start' in IPsec swanctl.conf #28583

@cotosso

Description

@cotosso

Package Name

strongswan

Maintainer

@pprindeville

OpenWrt Version

24.10.3

OpenWrt Target/Subtarget

x86/64

Steps to reproduce

  1. Configure an IPsec tunnel
  2. Set dpdaction to restart
uci set ipsec.children[-1].dpd_action='restart'
uci commit ipsec
  1. Restart the tunnel
    /etc/init.d/swanctl restart

Expected behavior

The generated configuration /var/swanctl/swanctl.conf should have this value:

dpd_action = restart

Actual Behaviour

The generated configuration /var/swanctl/swanctl.conf has this value instead:

dpd_action = start

According to the official strongSwan swanctl.conf documentation (https://docs.strongswan.org/docs/5.9/swanctl/swanctlConf.html) , valid values for dpd_action are:

  • clear
  • trap
  • restart

The value start is not valid and may cause unexpected behavior or misconfiguration.

Suggested fix

Update the configuration logic to write a valid dpd_action value (restart) instead of start.

root@vm:~# diff -u swanctl /etc/init.d/swanctl 
--- swanctl    2025-07-08 12:20:01.083401939 +0200
+++ /etc/init.d/swanctl    2025-07-08 12:20:24.923450986 +0200
@@ -314,7 +314,7 @@
     hold)
         dpdaction="trap" ;;
     restart)
-        dpdaction="start" ;;
+        dpdaction="restart" ;;
     trap|start)
         # already using new syntax
         ;;

Confirmation Checklist

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions