summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2013-07-30 14:07:58 -0400
committerjim-p <jimp@pfsense.org>2013-07-30 14:09:36 -0400
commit32fb33927d51dd73ba9d0ef5b483efe66328c92c (patch)
treee23454eb137cbc4041dad36fb55576a95eaf181e
parent07509027dd804fed11936a4e4ceb9e1569ae4266 (diff)
downloadpfsense-32fb33927d51dd73ba9d0ef5b483efe66328c92c.zip
pfsense-32fb33927d51dd73ba9d0ef5b483efe66328c92c.tar.gz
Fix up filter_pflog_start - optimize some code, and fix $retval so that it will be restarted correctly after killing it.
-rw-r--r--etc/inc/filter.inc7
1 files changed, 5 insertions, 2 deletions
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc
index 639bd28..5f4cc9d 100644
--- a/etc/inc/filter.inc
+++ b/etc/inc/filter.inc
@@ -108,13 +108,16 @@ function filter_pflog_start($kill_first = false) {
}
mute_kernel_msgs();
$output = 0;
- exec("/bin/pgrep -af 'tcpdump -s 256 -v -S -l -n -e -ttt -i pflog0'", $output, $retval);
+ $tcpdump_cmd = "tcpdump -s 256 -v -S -l -n -e -ttt -i pflog0";
+ exec("/bin/pgrep -af '{$tcpdump_cmd}'", $output, $retval);
if ($kill_first && ($output[0] > 1)) {
mwexec("/bin/kill {$output[0]}");
usleep(1000);
+ /* Ensure the restart below runs */
+ $retval = 1;
}
if($retval != 0)
- mwexec_bg("/usr/sbin/tcpdump -s 256 -v -S -l -n -e -ttt -i pflog0 | logger -t pf -p local0.info");
+ mwexec_bg("/usr/sbin/{$tcpdump_cmd} | logger -t pf -p local0.info");
unmute_kernel_msgs();
}
OpenPOWER on IntegriCloud