diff options
| author | Rbb666 <[email protected]> | 2025-09-13 11:29:35 +0800 |
|---|---|---|
| committer | R b b666 <[email protected]> | 2025-09-15 11:21:34 +0800 |
| commit | 1e81571256a411cc1a07fa8f49af739458833770 (patch) | |
| tree | dff093743b69c607040ec0006e90f0112d62d1bd /components/net/netdev/src | |
| parent | ff26c0c4b353de82d36bacb5cfd99e9a462216d6 (diff) | |
[net/netdev]Fixed compilation errors when enabling IPv6 and IPv4 dual-stack support.
Diffstat (limited to 'components/net/netdev/src')
| -rw-r--r-- | components/net/netdev/src/netdev.c | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/components/net/netdev/src/netdev.c b/components/net/netdev/src/netdev.c index 58247b1ee0..3b59522c15 100644 --- a/components/net/netdev/src/netdev.c +++ b/components/net/netdev/src/netdev.c @@ -1415,20 +1415,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) { |
