strongswan: Fix PSK's when using multiple connections
authorPhilip Prindeville <philipp@redfish-solutions.com>
Wed, 9 Nov 2022 03:07:48 +0000 (20:07 -0700)
committerJosef Schlehofer <pepe.schlehofer@gmail.com>
Mon, 24 Jun 2024 10:48:04 +0000 (12:48 +0200)
Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
(cherry picked from commit 796443267f797ddd2a219a5699097a9b215680a4)
Signed-off-by: Richard Muzik <richard.muzik@nic.cz>
net/strongswan/files/swanctl.init

index 14b56e838c1708729fa396eca77411fd1cf36881..9d34b1041db03104d772e9036a4a7c2c6e9088be 100644 (file)
@@ -544,12 +544,12 @@ config_connection() {
                swanctl_xappend0 ""
 
                swanctl_xappend0 "secrets {"
-               swanctl_xappend1 "ike {"
+               swanctl_xappend1 "ike-$config_name {"
                swanctl_xappend2 "secret = $pre_shared_key"
-               if [ -n "$local_id" ]; then
-                       swanctl_xappend2 "id1 = $local_id"
-                       if [ -n "$remote_id" ]; then
-                               swanctl_xappend2 "id2 = $remote_id"
+               if [ -n "$local_identifier" ]; then
+                       swanctl_xappend2 "id1 = $local_identifier"
+                       if [ -n "$remote_identifier" ]; then
+                               swanctl_xappend2 "id2 = $remote_identifier"
                        fi
                fi
                swanctl_xappend1 "}"