Commit Graph

12 Commits

Author SHA1 Message Date
meijian
255df7c01f [ping] fix ping error busyloop add goto wait
Signed-off-by: meijian <meijian@xiaomi.com>
2024-04-22 23:03:39 +02:00
meijian
a7cffe03b5 [ping] fix ping early return when ping is interrupted by ifdown
During a long ping, the tester will repeatedly switch the dev interface on and off.
When the interface is down and ping is in sendto sem_wait state,ifdown will trigger event of sendto and post sem.
in func of sendto_eventhandler:
if ((flags & NETDEV_DOWN) != 0)
{
  nerr("ERROR: Interface is down\n");
  pstate->snd_result = -ENETUNREACH;
  goto end_wait;
}

Signed-off-by: meijian <meijian@xiaomi.com>
2024-04-22 23:03:39 +02:00
meijian
c0c9a6007c [ping] fix ping early return when ping is interrupted by ifdown and poll return
During a long ping, the tester will repeatedly switch the dev interface on and off.
When the interface is down and ping is in poll sem_wait state,ifdown will trigger event of poll and post sem.
The poll will return and revent is 0x18 POLLHUP | POLLERR.Then recvfrom will process and return error to stop ping.
if ((flags & NETDEV_DOWN) != 0)
{
  eventset |= (POLLHUP | POLLERR);
}

Signed-off-by: meijian <meijian@xiaomi.com>
2024-04-22 23:03:39 +02:00
Zhe Weng
9489659890 netutils/ping: Optimize stack usage of icmp_ping
Can reduce 88~144 Bytes on ARMv7-A depending on optimization level.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2024-01-02 19:47:23 +01:00
zhouliang3
426cc840d8 apps/ping: fix ping statistics error problem
nsh> ping 192.168.31.162
PING 192.168.31.162 56 bytes of data
56 bytes from 192.168.31.162: icmp_seq=0 time=8 ms
56 bytes from 192.168.31.162: icmp_seq=1 time=27 ms
56 bytes from 192.168.31.162: icmp_seq=2 time=17 ms
56 bytes from 192.168.31.162: icmp_seq=3 time=14 ms
56 bytes from 192.168.31.162: icmp_seq=4 time=16 ms
56 bytes from 192.168.31.162: icmp_seq=5 time=14 ms
56 bytes from 192.168.31.162: icmp_seq=6 time=8 ms
56 bytes from 192.168.31.162: icmp_seq=7 time=87 ms
WARNING: Received after timeout
56 bytes from 192.168.31.162: icmp_seq=8 time=1003 ms
56 bytes from 192.168.31.162: icmp_seq=8 time=6 ms
56 bytes from 192.168.31.162: icmp_seq=9 time=5 ms
10 packets transmitted, 11 received, 4294967287% packet loss, time 10011 ms

Signed-off-by: zhouliang3 <zhouliang3@xiaomi.com>
2022-04-25 22:12:42 +08:00
chao.an
b8b9d45706 netutils/ping: skip the id check
https://joekuan.wordpress.com/2017/05/30/behaviour-of-identifier-field-in-icmp-ping-as-udp-between-linux-and-osx/
https://lwn.net/Articles/443051/

https: //github.com/apache/incubator-nuttx-apps/blob/master/netutils/ping/icmp_ping.c#L298

Signed-off-by: chao.an <anchao@xiaomi.com>
2022-04-14 23:23:07 +03:00
xuewenliang
c69ec94d13 Modifying the ping command
1、Round trip times in the ping command range from millisecond to subtle
2、Add statistics on RTT related min/avg/Max/mdev in ping program
3、The ping command supports ctrl+c interruption operations

Signed-off-by: xuewenliang <xuewenliang@xiaomi.com>
2022-03-18 09:54:01 +08:00
Xiang Xiao
837b405624 Change all files come from Xiaomi/Pinecone to Apache License 2.0
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-08-23 15:44:32 -06:00
Juha Niskanen
f8f16975a9 webclient: use getaddrinfo to get IPv4 addresses on dual stack systems
Signed-off-by: Juha Niskanen <juha.niskanen@haltian.com>
2020-04-23 09:29:36 -06:00
Xiang Xiao
595c72b38e
ping/ping6: Support the dual stack host correctly 2020-03-31 22:18:26 +01:00
Xiang Xiao
857158451b Unify the void cast usage
1.Remove void cast for function because many place ignore the returned value witout cast
2.Replace void cast for variable with UNUSED macro

Change-Id: Ie644129a563244a6397036789c4c3ea83c4e9b09
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-01-02 23:21:01 +08:00
ligd
f954b15cac pps/system/ping and pings and apps/netutils/ping: Extract icmp ping and icmpv6 ping6 logic from system/ to C-callable library in netutils/. 2018-11-08 09:32:05 -06:00