From: Simon Xu <xu....@or...> - 2013-11-15 01:24:23
|
Could anyone help to review? Thanks Simon On 2013/11/11 14:08, Simon Xu wrote: > Always specify interface for ping because it is possible that pings to RHOST > can go through multiple interfaces. Also add -q to ping. > > Signed-off-by: Simon Xu <xu....@or...> > --- > testcases/network/tcp_cmds/tcpdump/tcpdump01 | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/testcases/network/tcp_cmds/tcpdump/tcpdump01 b/testcases/network/tcp_cmds/tcpdump/tcpdump01 > index 6d6d399..6296ad2 100755 > --- a/testcases/network/tcp_cmds/tcpdump/tcpdump01 > +++ b/testcases/network/tcp_cmds/tcpdump/tcpdump01 > @@ -51,7 +51,7 @@ do_setup() > # Find the first interface that can ping RHOST > IF="" > for i in $(netstat -i | tail -n+3 | sed '/^lo/d' | cut -f1 -d' '); do > - ping -I $i -c 3 $RHOST && { IF="$i"; break; } > + ping -I $i -c 3 -q $RHOST && { IF="$i"; break; } > done > test -z $IF && end_testcase "Could not find an interface that can ping remote host $RHOST" > IFNAME=${IF} > @@ -62,7 +62,7 @@ do_setup() > > do_test() > { > - ping -f $RHOST > /dev/null 2>&1 & > + ping -I $IFNAME -f $RHOST > /dev/null 2>&1 & > if ! tcpdump -i $IFNAME -c $NUMLOOPS > $OUTFILE; then > end_testcase "Problems trying to launch tcpdump" > fi |