VPN: IPsec - fix regression in https://github.com/opnsense/core/commit/b440c12e80b86, all indexed fields are flushed into the config, these virtual ones shouldn't go there. closes https://github.com/opnsense/core/issues/9022

This commit is contained in:
Ad Schellevis 2025-07-31 22:35:58 +02:00
parent ec1a7a30f1
commit c2a7d1a913

View file

@ -191,7 +191,10 @@ class Swanctl extends BaseModel
$parent = null;
$thisnode = [];
foreach ($node->iterateItems() as $attr_name => $attr) {
if ($attr_name == 'connection' && isset($data['connections'][(string)$attr])) {
if ($key == 'connections' && in_array($attr_name ,['local_ts', 'remote_ts'])) {
/* virtual nodes belonging to child */
continue;
} elseif ($attr_name == 'connection' && isset($data['connections'][(string)$attr])) {
$parent = (string)$attr;
continue;
} elseif ($attr_name == 'pools') {