Skip to content

Commit c6eaefc

Browse files
committed
firewall: run filterlog directly after rules apply for #9449
1 parent bb6f595 commit c6eaefc

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/etc/inc/filter.inc

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -438,8 +438,17 @@ function filter_configure_sync($verbose = false, $load_aliases = true)
438438
return;
439439
}
440440

441+
service_log('.', $verbose);
442+
443+
/* enable permanent promiscuous mode to avoid dmesg noise */
444+
mwexecf('/sbin/ifconfig pflog0 promisc');
445+
446+
/* bring up new instance of filterlog to load new rules */
447+
killbypid('/var/run/filterlog.pid');
448+
mwexecf('/usr/local/sbin/filterlog -i pflog0 -p %s', '/var/run/filterlog.pid');
449+
441450
/*
442-
* XXX: Flush table when not user, ideally this should be update_tables.py responsibility.
451+
* XXX: Flush table when not used, ideally this should be update_tables.py responsibility.
443452
*/
444453
if (!is_bogonsv6_used()) {
445454
mwexecf('/sbin/pfctl -t bogonsv6 -T flush');
@@ -452,15 +461,6 @@ function filter_configure_sync($verbose = false, $load_aliases = true)
452461
configd_run('filter refresh_aliases', true);
453462
}
454463

455-
service_log('.', $verbose);
456-
457-
/* enable permanent promiscuous mode to avoid dmesg noise */
458-
mwexecf('/sbin/ifconfig pflog0 promisc');
459-
460-
/* bring up new instance of filterlog to load new rules */
461-
killbypid('/var/run/filterlog.pid');
462-
mwexecf('/usr/local/sbin/filterlog -i pflog0 -p %s', '/var/run/filterlog.pid');
463-
464464
unset($fobj);
465465

466466
reopenlog();

0 commit comments

Comments
 (0)