Timeout for echo ping does not work
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
echoping (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
When using echoping for pinging to tcp/7 (echo), and the remote hosts opens the connection but does not answer, the timeout parameter does not work.
== Steps to reproduce ==
Server side:
sudo nc -l -p 7
do NOT type anything into it
Client side:
echoping -t 1 127.0.0.1
Expected result:
netcat (nc) shows some random data,
echoping returns after 1 second with exit code 1
What happened instead:
netcat shows some random data,
echoping waits forever or until somthing was typed into the netcat console (in my test I waited 12 minutes). In that case, echoping prints "Timeout while reading (2 byte(s) read)" and returns with exit code 1
---
~$ time echoping -t 1 127.0.0.1
Timeout while reading (2 byte(s) read)
real 12m14.953s
user 0m0.000s
sys 0m0.008s
~$ echo $?
1
---
It seems that timeout is only used for connecting, probably also for sending, but not for receiving the answer.
In contrast, pinging to a non-existing host works perfectly:
---
~$ time echoping -t 1 1.1.1.1
Timeout while connecting
real 0m1.006s
user 0m0.004s
sys 0m0.008s
~$ time echoping -t 2 1.1.1.1
Timeout while connecting
real 0m2.006s
user 0m0.000s
sys 0m0.008s
~$
---
Sorry, I forgot to mention the version:
Version: 6.0.2-4, and also the latest from git repository
uname -a:
Linux cisgimli 3.2.0-26-generic #41-Ubuntu SMP Thu Jun 14 16:26:01 UTC 2012 i686 i686 i386 GNU/Linux