* [LTP] [PATCH] tcpdump01: specify interface for ping
@ 2013-11-11 6:08 Simon Xu
2013-11-15 1:23 ` Simon Xu
2013-11-20 16:14 ` chrubis
0 siblings, 2 replies; 3+ messages in thread
From: Simon Xu @ 2013-11-11 6:08 UTC (permalink / raw)
To: ltp-list
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.simon@oracle.com>
---
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
--
1.8.4.2
------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [LTP] [PATCH] tcpdump01: specify interface for ping
2013-11-11 6:08 [LTP] [PATCH] tcpdump01: specify interface for ping Simon Xu
@ 2013-11-15 1:23 ` Simon Xu
2013-11-20 16:14 ` chrubis
1 sibling, 0 replies; 3+ messages in thread
From: Simon Xu @ 2013-11-15 1:23 UTC (permalink / raw)
To: ltp-list
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.simon@oracle.com>
> ---
> 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
------------------------------------------------------------------------------
DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [LTP] [PATCH] tcpdump01: specify interface for ping
2013-11-11 6:08 [LTP] [PATCH] tcpdump01: specify interface for ping Simon Xu
2013-11-15 1:23 ` Simon Xu
@ 2013-11-20 16:14 ` chrubis
1 sibling, 0 replies; 3+ messages in thread
From: chrubis @ 2013-11-20 16:14 UTC (permalink / raw)
To: Simon Xu; +Cc: ltp-list
Hi!
> 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.simon@oracle.com>
Pushed, thanks.
--
Cyril Hrubis
chrubis@suse.cz
------------------------------------------------------------------------------
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing
conversations that shape the rapidly evolving mobile landscape. Sign up now.
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-11-20 16:14 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-11 6:08 [LTP] [PATCH] tcpdump01: specify interface for ping Simon Xu
2013-11-15 1:23 ` Simon Xu
2013-11-20 16:14 ` chrubis
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.