shaper: make sure dnctl is started before pf

We cannot guarantee this happens via RC, so skip it there and
unconditionally reload it during the filter reload.
This commit is contained in:
Stephan de Wit 2025-03-07 13:35:16 +01:00
parent 78e6a097b7
commit d52f6ca1f2
3 changed files with 4 additions and 1 deletions

View File

@ -373,6 +373,8 @@ function filter_configure_sync($verbose = false, $load_aliases = true)
$fobj->truncate(0)->write($rules);
configd_run('shaper reload');
@file_put_contents('/tmp/rules.limits', $limitrules);
mwexec('/sbin/pfctl -Of /tmp/rules.limits');
exec('/sbin/pfctl -f /tmp/rules.debug 2>&1', $rules_error, $rules_loading);

View File

@ -1,5 +1,5 @@
[reload]
command:/etc/rc.d/dnctl start
command:/etc/rc.d/dnctl start || true
parameters:
type:script
message:restarting dummynet

View File

@ -10,3 +10,4 @@ dummynet_enable="YES"
dnctl_enable="{%if isEnabled %}YES{% else %}NO{% endif %}"
dnctl_rules="/usr/local/etc/dnctl.conf"
dnctl_setup="/usr/local/opnsense/scripts/shaper/setup.sh"
dnctl_skip="YES"