Skip to content

Commit 83ef4a3

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

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
@@ -1414,20 +1414,8 @@ int netdev_cmd_ping(char* target_name, char *netdev_name, rt_uint32_t times, rt_
14141414
/* print ping statistics */
14151415
loss = (uint32_t)((1 - ((float)received) / index) * 100);
14161416
avg_time = (uint32_t)(avg_time / received);
1417-
#if NETDEV_IPV4 && NETDEV_IPV6
1418-
if (IP_IS_V4_VAL(&ping_resp.ip_addr))
1419-
{
1420-
rt_kprintf("\n--- %s ping statistics ---\n", inet_ntoa(*ip_2_ip4(&ping_resp.ip_addr)));
1421-
}
1422-
else
1423-
{
1424-
rt_kprintf("\n--- %s ping statistics ---\n", inet6_ntoa(*ip_2_ip6(&ping_resp.ip_addr)));
1425-
}
1426-
#elif NETDEV_IPV4
1417+
14271418
rt_kprintf("\n--- %s ping statistics ---\n", inet_ntoa(ping_resp.ip_addr));
1428-
#elif NETDEV_IPV6
1429-
rt_kprintf("\n--- %s ping statistics ---\n", inet6_ntoa(ping_resp.ip_addr));
1430-
#endif
14311419
rt_kprintf("%d packets transmitted, %d received, %d%% packet loss\n", index, received, loss);
14321420
if (received > 0)
14331421
{

0 commit comments

Comments
 (0)