diff mbox series

[v2,09/13] lwip: ping: accept host name when CONFIG_CMD_DNS=y

Message ID 20250606064211.3091237-10-jerome.forissier@linaro.org
State New
Headers show
Series sntp for NET_LWIP | expand

Commit Message

Jerome Forissier June 6, 2025, 6:41 a.m. UTC
Update the ping command so that a host name is accepted in addition to
an IP address, provided DNS support is enabled.

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
---

Changes in v2:
- New patch

 cmd/lwip/ping.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/cmd/lwip/ping.c b/cmd/lwip/ping.c
index 21931821521..9fe02a21a78 100644
--- a/cmd/lwip/ping.c
+++ b/cmd/lwip/ping.c
@@ -14,7 +14,7 @@ 
 #include <time.h>
 
 U_BOOT_CMD(ping, 2, 1, do_ping, "send ICMP ECHO_REQUEST to network host",
-	   "pingAddress");
+	   "pingAddressOrHostName");
 
 #define PING_DELAY_MS 1000
 #define PING_COUNT 5
@@ -168,7 +168,7 @@  int do_ping(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
 	if (argc < 2)
 		return CMD_RET_USAGE;
 
-	if (!ipaddr_aton(argv[1], &addr))
+	if (net_lwip_dns_resolve(argv[1], &addr))
 		return CMD_RET_USAGE;
 
 restart: