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 (simplified version which will ignore future volatile fields)

This commit is contained in:
Ad Schellevis 2025-07-31 22:45:37 +02:00
parent c2a7d1a913
commit ccfa210433

View file

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