summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2012-09-04 11:58:38 -0400
committerjim-p <jimp@pfsense.org>2012-09-04 11:58:38 -0400
commit744306c6bd08b506c22d16214b6e479936b4857c (patch)
treeb51f44c05bd3a30719ffd38b00e5aebaee1c1a15 /etc
parentdaa06fb79f82e95d3d53106f2f56f20505e5e9e6 (diff)
downloadpfsense-744306c6bd08b506c22d16214b6e479936b4857c.zip
pfsense-744306c6bd08b506c22d16214b6e479936b4857c.tar.gz
Fix up tcpdump for pflog stop/start a little, consolodate code, and restart tcpdump for pflog when saving log settings.
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/filter.inc6
1 files changed, 5 insertions, 1 deletions
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc
index a8bb169..0b2b883 100644
--- a/etc/inc/filter.inc
+++ b/etc/inc/filter.inc
@@ -113,7 +113,7 @@ function filter_load_ipfw() {
}
}
-function filter_pflog_start() {
+function filter_pflog_start($kill_first = false) {
global $config, $g;
if ($g['platform'] == 'jail')
return;
@@ -124,6 +124,10 @@ function filter_pflog_start() {
mute_kernel_msgs();
$output = 0;
exec("/bin/pgrep -af 'tcpdump -s 256 -v -l -n -e -ttt -i pflog0'", $output, $retval);
+ if ($kill_first && ($output[0] > 1)) {
+ mwexec("/bin/kill {$output[0]}");
+ usleep(1000);
+ }
if($retval != 0)
mwexec_bg("/usr/sbin/tcpdump -s 256 -v -l -n -e -ttt -i pflog0 | logger -t pf -p local0.info");
unmute_kernel_msgs();
OpenPOWER on IntegriCloud