Skip to content

Commit 1e81571

Browse files
committed
[net/netdev]Fixed compilation errors when enabling IPv6 and IPv4 dual-stack support.
1 parent ff26c0c commit 1e81571

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

components/net/netdev/src/netdev.c

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1415,20 +1415,8 @@ int netdev_cmd_ping(char* target_name, char *netdev_name, rt_uint32_t times, rt_
14151415
/* print ping statistics */
14161416
loss = (uint32_t)((1 - ((float)received) / index) * 100);
14171417
avg_time = (uint32_t)(avg_time / received);
1418-
#if NETDEV_IPV4 && NETDEV_IPV6
1419-
if (IP_IS_V4_VAL(&ping_resp.ip_addr))
1420-
{
1421-
rt_kprintf("\n--- %s ping statistics ---\n", inet_ntoa(*ip_2_ip4(&ping_resp.ip_addr)));
1422-
}
1423-
else
1424-
{
1425-
rt_kprintf("\n--- %s ping statistics ---\n", inet6_ntoa(*ip_2_ip6(&ping_resp.ip_addr)));
1426-
}
1427-
#elif NETDEV_IPV4
1418+
14281419
rt_kprintf("\n--- %s ping statistics ---\n", inet_ntoa(ping_resp.ip_addr));
1429-
#elif NETDEV_IPV6
1430-
rt_kprintf("\n--- %s ping statistics ---\n", inet6_ntoa(ping_resp.ip_addr));
1431-
#endif
14321420
rt_kprintf("%d packets transmitted, %d received, %d%% packet loss\n", index, received, loss);
14331421
if (received > 0)
14341422
{

0 commit comments

Comments
 (0)