Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 1 addition & 13 deletions components/net/netdev/src/netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -1414,20 +1414,8 @@ int netdev_cmd_ping(char* target_name, char *netdev_name, rt_uint32_t times, rt_
/* print ping statistics */
loss = (uint32_t)((1 - ((float)received) / index) * 100);
avg_time = (uint32_t)(avg_time / received);
#if NETDEV_IPV4 && NETDEV_IPV6
if (IP_IS_V4_VAL(&ping_resp.ip_addr))
{
rt_kprintf("\n--- %s ping statistics ---\n", inet_ntoa(*ip_2_ip4(&ping_resp.ip_addr)));
}
else
{
rt_kprintf("\n--- %s ping statistics ---\n", inet6_ntoa(*ip_2_ip6(&ping_resp.ip_addr)));
}
#elif NETDEV_IPV4

rt_kprintf("\n--- %s ping statistics ---\n", inet_ntoa(ping_resp.ip_addr));
#elif NETDEV_IPV6
rt_kprintf("\n--- %s ping statistics ---\n", inet6_ntoa(ping_resp.ip_addr));
#endif
rt_kprintf("%d packets transmitted, %d received, %d%% packet loss\n", index, received, loss);
if (received > 0)
{
Expand Down