diff options
author | Alexander Couzens <lynxis@fe80.eu> | 2018-05-12 16:52:59 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2018-05-15 20:54:54 +0000 |
commit | d1f4095df8d8591c938a1bd8bf67d9b42f74b58c (patch) | |
tree | 730a5bcb25076fad7d4cca32ed0b44e3aacee33c | |
parent | 5844d5b2eca10b6c2f76db46c81f11fc241fec00 (diff) |
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
-rwxr-xr-x | ttcn3-tcpdump-start.sh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ttcn3-tcpdump-start.sh b/ttcn3-tcpdump-start.sh index 7321b520..395941d4 100755 --- a/ttcn3-tcpdump-start.sh +++ b/ttcn3-tcpdump-start.sh @@ -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 |