ttcn3-tcpdump-start.sh: reduce snaplen of tcpdump

Improve speed of tcpdump startup. -s 0 sets the snaplen is 256k.
tcpdump will request the snaplen multiplied by the buffer as
a contigous buffer in the kernel. This could lead to higher
start time.

Change-Id: I8a372e71798b366faa3b723573c60de6e8fd128f
This commit is contained in:
Alexander Couzens 2018-05-12 16:52:59 +02:00 committed by Harald Welte
parent 5844d5b2ec
commit d1f4095df8
1 changed files with 2 additions and 2 deletions

View File

@ -20,7 +20,7 @@ if [ "$(id -u)" = "0" ]; then
else
CMD="sudo $TCPDUMP"
fi
$CMD -U -s 0 -n -i any -w "$TTCN3_PCAP_PATH/$TESTCASE.pcap" >$TTCN3_PCAP_PATH/$TESTCASE.pcap.stdout 2>&1 &
$CMD -U -s 1500 -n -i any -w "$TTCN3_PCAP_PATH/$TESTCASE.pcap" >$TTCN3_PCAP_PATH/$TESTCASE.pcap.stdout 2>&1 &
PID=$!
echo $PID > $PIDFILE
@ -31,7 +31,7 @@ ping 127.0.0.1 >/dev/null 2>&1 &
PID=$!
i=0
while [ ! -f "$TTCN3_PCAP_PATH/$TESTCASE.pcap" ] ||
[ "$($TCPDUMP -r "$TTCN3_PCAP_PATH/$TESTCASE.pcap" 2>/dev/null | wc -l)" -eq 0 ]
[ "$(stat -c '%s' "$TTCN3_PCAP_PATH/$TESTCASE.pcap")" -eq 32 ]
do
echo "Waiting for tcpdump to start... $i"
sleep 1