write changes some parts of the config, if this is a reference to the
config used for checking parsing it may lead to unexpected failures
due to those side effects..
For me it was "cidr" and "cidr6" getting deleted, and thus upcomming
tests for a compat change failing without any apparent reason.. :/
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
use Carp;
use POSIX;
use IO::Handle;
+use Storable qw(dclone);
use PVE::INotify;
# Turn the current network config into a string.
sub w() {
- return PVE::INotify::__write_etc_network_interfaces($config);
+ # write shouldn't be able to change a previously parsed config
+ my $config_clone = dclone($config);
+ return PVE::INotify::__write_etc_network_interfaces($config_clone);
}
##