]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
lwip: ping: accept host name when CONFIG_CMD_DNS=y
authorJerome Forissier <jerome.forissier@linaro.org>
Wed, 25 Jun 2025 13:19:17 +0000 (15:19 +0200)
committerJerome Forissier <jerome.forissier@linaro.org>
Tue, 8 Jul 2025 09:07:37 +0000 (11:07 +0200)
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>
cmd/lwip/ping.c

index 6996931fa4045d7ee805c5b424da66a717bc5ac8..87f8e958e485cef4e772a230ddfbb4cb366654de 100644 (file)
@@ -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
@@ -167,7 +167,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: