firewall: finish up the gaps in #10684
The gateway status is read inside the monitor hooks by external
scripts as well as the state kill t the end and should have also
been used in the filter reload. We should also refrain from state
kills if the rules don't reload.
The solution is to move the status to a temporary file and export
an environment variable so that subsequent reads for the status
all get the same information. This way we can fix user scripts
without touching them.
While the side effect is not ideal it's narrowly scoped and easily
traceable.
firewall: finish up the gaps in #10684
The gateway status is read inside the monitor hooks by external
scripts as well as the state kill t the end and should have also
been used in the filter reload. We should also refrain from state
kills if the rules don't reload.
The solution is to move the status to a temporary file and export
an environment variable so that subsequent reads for the status
all get the same information. This way we can fix user scripts
without touching them.
While the side effect is not ideal it's narrowly scoped and easily
traceable.
VPN: OpenVPN: Instances - recreate a leftover DCO interface before start (#11344)
* VPN: OpenVPN: Instances - recreate a leftover DCO interface before start
if_ovpn keeps the UDP socket of the first peer until the interface is
destroyed. OpenVPN only destroys interfaces it created itself, and
setup_interface() always creates it first, so after a restart with a
client connected, or a crash, the next bind fails with EADDRINUSE and
the instance stays down until a reboot.
Destroy the interface before creating it again when no process is
using it.
refs https://github.com/opnsense/core/issues/10784
* VPN: OpenVPN: Instances - only set up the interface when the instance is not running
setup_interface() forces the interface down before handing it over to
OpenVPN. A start on an instance that is already running did the same to
[5 lines not shown]
AGENTS.md: continuation of https://github.com/opnsense/core/pull/11290 (#11355)
---------
Co-authored-by: Stephen Cox <stephencoxmail at gmail.com>
Co-authored-by: Monviech <79600909+Monviech at users.noreply.github.com>
git: AGENTS.md - add pre-submission checks and a translation note
Check master and open PRs first, test on a running OPNsense and keep
unit tests to risk areas, use the PR template, and mention a changed
gettext() string, as it drops the existing translations.
Assisted-by: Claude:claude-opus-5-5
firewall: finish up the gaps in #10684
The gateway status is read inside the monitor hooks by external
scripts as well as the state kill t the end and should have also
been used in the filter reload. We should also refrain from state
kills if the rules don't reload.
The solution is to move the status to a temporary file and export
an environment variable so that subsequent reads for the status
all get the same information. This way we can fix user scripts
without touching them.
While the side effect is not ideal it's narrowly scoped and easily
traceable.