Commit dfcdbd61 authored by Ad Schellevis's avatar Ad Schellevis Committed by Franco Fichtner

(packet capture) limit the maximum number of output lines, prevent "PHP Fatal...

(packet capture) limit the maximum number of output lines, prevent "PHP Fatal error:  Allowed memory size of ..."

collected from crashreport

(cherry picked from commit aab13817)
parent a0d8768a
......@@ -186,7 +186,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
}
$result = array();
$dump_output = array();
exec("/usr/sbin/tcpdump {$disabledns} {$detail_args} -r /tmp/packetcapture.cap", $dump_output);
exec("/usr/sbin/tcpdump {$disabledns} {$detail_args} -r /tmp/packetcapture.cap | /usr/bin/tail -n 5000", $dump_output);
// reformat raw output to 1 packet per array item
foreach ($dump_output as $line) {
if ($line[0] == ' ' && count($result) > 0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment