Once upon a time we tried to treat this script as an external one
since it's still maintained somewhat in FreeBSD but the approach
of integration is much different so the script ends up with half
of its code not doing anything and perhaps more than it should.
Upstream fixes are also not full applicable anymore.
* Clear the writing of the host name. The system does that. Simply
keep the logging aspect of it (if given).
* Remove the $ARP flush on TIMEOUT/EXPIRE as it seems misplaced.
* Remove exit_with_hooks() and is_default_interface() as these are
tools that are not needed in our integration approach.
* While trailing TIMEOUT/EXPIRE failure case make sure to run
newwanip in optional mode in order to pick up missing configuration.
* Copyright the changes from 2021 onwards that offer substantial
changes to the way the script integration works or cooperates with
the rest of the system.
* Inline the one-time use of functions.
* Remove tip-toeing around $resolvconf_enable.
* Ignore dhclient-enter-hooks.
* Remove commented-out code.
When \Deciso\OPNcentral\Central exists, there might be multiple providers to select from, so we can easily reuse the same component in both versions.
closes https://github.com/opnsense/core/issues/6828
Local backup configuration would be best stored in the backup configuration for consistency. Eventually we should refactor the backup configuration as well, but while refactoring the history page and adding a host selection (when used in conjunction with OPNcentral), this setting is a bit out of place.
Testing 3582242d0fe10 it appeared that link-local addresses were
rewritten as GUAs in the dhcpd configuration. The static map part
does this right, but all the other callers are not. Flip this
around as it was intended. The DHCPv6 page will now throw an out
of range error when it previously adjusted the explit prefix anyway.
dhcpd config with link local seems fine too, but more testing is
always good.
MaskPerItem=Y needs work and the preg_match() shoudldn't be used
to look inside the match which creates the initial problem:
/usr/local/opnsense/mvc/app/controllers/OPNsense/Base/ApiControllerBase.php:176:
Error at /usr/local/opnsense/mvc/app/models/OPNsense/Base/FieldTypes/CSVListField.php:162 - Undefined array key 0 (errno=2)
If we ever derive from UnqiueIdField we would end up overwriting
this message and there is no data validation involved which the
message would be for so it can be null as per BaseField.
The validation message is never seen anymore and can't be overridden.
While the field made sure to emit a message on empty the result is
that if we ever have to use this group field as optional we would have
to pivot to this approach anyway.
We could use defaultValidationMessage() but the BaseListField message
is fitting enough and the GUI itself cannot cause this to happen.
The reason for stripping is also that the variable is not handled by
the field so there is no special validation meaning attached either.
For BaseField derivates the idea was to set a custom required validation
message which is no longer possible or possibly not even reachable.
* provide defaultValidationMessage() to inject gettext-supported string
* assume $internalValidationMessage can only be set by XML now
* the goal here is to translate and improve all the field validation messages
To be honest the page was horrible. Originally I wanted to reduce
the bridge validation code using interface_parent_devices() but
ended up renaming a lot of variables from "port" to "dev(ice)" and
started renaming the table headers for clarity which ended up in
splitting the add interface section from the list/modify section
which ended up restyling the whole table for better mobile use and
clear separation of functionality. Also added a note to the add
section when no devices are available for assignment.
This should in theory prevent a number of support questions and
mistakes seen over the years WRT using this page.