From fc6e169a470b22b2c7d159a3f95796afbf80f2ac Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Tue, 4 Mar 2025 09:55:02 +0100 Subject: [PATCH] xmlrpc: time for some spring cleaning before working on https://github.com/opnsense/core/issues/8394 The $sync_full construct always looked a bit weird, certainly as different other comparable config sections don't seem to have the same issue as mentioned in the original commit (https://github.com/pfsense/pfsense/commit/1b99e1e53a75e3e439f4b66d8d5b863250fdfc42). Tried the nat rules on an existing setup after this change, which still works like a charm. --- src/etc/inc/xmlrpc/legacy.inc | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/src/etc/inc/xmlrpc/legacy.inc b/src/etc/inc/xmlrpc/legacy.inc index d5a9d146f..280741d1b 100644 --- a/src/etc/inc/xmlrpc/legacy.inc +++ b/src/etc/inc/xmlrpc/legacy.inc @@ -1,7 +1,7 @@ * Copyright (C) 2005 Colin Smith * All rights reserved. @@ -150,19 +150,6 @@ function restore_config_section_xmlrpc($new_config) // save old config $old_config = $config; - // Some sections should just be copied and not merged, namely if there's a risk of attributes being removed - // without being seen by the remote (backup) side. - // (ipsec, openvpn, nat can probably moved out later by specifying a better path to the attribute) - $sync_full = ['ipsec', 'wol', 'dnsmasq', 'openvpn', 'nat', 'dhcpd', 'dhcpv6']; - $sync_full_done = []; - foreach ($sync_full as $syncfull) { - if (isset($new_config[$syncfull])) { - $config[$syncfull] = $new_config[$syncfull]; - unset($new_config[$syncfull]); - $sync_full_done[] = $syncfull; - } - } - $vhidVipsInNewConfig = []; if (isset($new_config['virtualip']['vip'])) { foreach ($new_config['virtualip']['vip'] as $vip) { @@ -199,7 +186,7 @@ function restore_config_section_xmlrpc($new_config) } /* Log what happened */ - $mergedkeys = implode(",", array_merge(array_keys($new_config), $sync_full_done)); + $mergedkeys = implode(",", array_merge(array_keys($new_config))); write_config(sprintf('Merged %s config sections from XMLRPC client.', $mergedkeys)); /*