diff options
author | jim-p <jimp@pfsense.org> | 2013-07-30 14:07:58 -0400 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2013-07-30 14:09:36 -0400 |
commit | 32fb33927d51dd73ba9d0ef5b483efe66328c92c (patch) | |
tree | e23454eb137cbc4041dad36fb55576a95eaf181e /etc | |
parent | 07509027dd804fed11936a4e4ceb9e1569ae4266 (diff) | |
download | pfsense-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.
Diffstat (limited to 'etc')
-rw-r--r-- | etc/inc/filter.inc | 7 |
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(); } |