Rework handling of the config cache file
Move the removal of the configuration cache file from config_read_file()
to config_write_file(). With this change the cache does not have to be
manually removed after a change, including in the following cases:
- In config_provider_init(). The cache should be up-to-date regardless of
the configuration provider.
- In restore_config_section(). The "subsequent requests" will already use
an up-to-date cache (see a57d6170198bf46e21a178732b32982ed8b8ab62).
- In backup.inc execPost() when restoring a specific area. The previous
write already removes the cache.
- In backup.inc execPost() when doing a full restore. The call to
config_install() and write_config() already removes the cache.
- In rc.filter_configure. The cache should be up-to-date at this point.
- In write_config() when reading back the written config. The call to
config_write_file() already results in the cache being removed.
- In usermgrpasswd when re-reading the config in case of changes outside
the script, i.e. from the GUI.
- In interfaces.php when applying changes. It's no longer relevant since
[21 lines not shown]
Include more error info for filter reload failures
In some cases the line referenced by the error is syntatically correct, in
which case it may be helpful to see the return of the command as well.
Use the IPv6 interface address as the OpenVPN server gateway. Fix #16351
In OpenVPN server configurations OpenVPN sets the environment variable
"ifconfig_ipv6_remote" when an IPv6 tunnel network is specified. This is
not the case for IPv4 and its respective variables. These variables are
later used to create a gateway for assigned interfaces in which case the
gateway address should always be the local interface address.
Fix input validation for NAT64 destination type
When the option to overide the prefix is enabled, the destination type
should remain enabled so that the POST request contains the value and
triggers the correct input validation.