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
diff --git a/ttcn3-tcpdump-start.sh b/ttcn3-tcpdump-start.sh
index 7321b52..395941d 100755
--- a/ttcn3-tcpdump-start.sh
+++ b/ttcn3-tcpdump-start.sh
@@ -20,7 +20,7 @@
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 @@
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