diff options
author | Viacheslav Mitrofanov <v.v.mitrofanov@yadro.com> | 2022-12-02 12:18:08 +0300 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2022-12-05 12:47:16 -0500 |
commit | eeb0a2c6938226ee3c46fa66971da9231d64667d (patch) | |
tree | 6eb7a6f8caca4976f1f78afa9f229b41e704f67b /net/net.c | |
parent | 7fbf230d79ad531e680475529191e2ec08099c7d (diff) |
net: ping6: Add ping6 command
Implement ping6 command to ping hosts using IPv6. It works the same way as
an ordinary ping command. There is no ICMP request so it is not possible
to ping our host. This patch adds options in Kconfig and Makefile to
build ping6 command.
Series-changes: 3
- Added structures and functions descriptions
- Added to ping6_receive() return value instead of void
Series-changes: 4
- Fixed structures and functions description style
Signed-off-by: Viacheslav Mitrofanov <v.v.mitrofanov@yadro.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'net/net.c')
-rw-r--r-- | net/net.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/net/net.c b/net/net.c index 28c8dfdef23..1c39acc4936 100644 --- a/net/net.c +++ b/net/net.c @@ -525,6 +525,11 @@ restart: ping_start(); break; #endif +#if defined(CONFIG_CMD_PING6) + case PING6: + ping6_start(); + break; +#endif #if defined(CONFIG_CMD_NFS) && !defined(CONFIG_SPL_BUILD) case NFS: nfs_start(); @@ -1434,6 +1439,14 @@ static int net_check_prereq(enum proto_t protocol) } goto common; #endif +#if defined(CONFIG_CMD_PING6) + case PING6: + if (ip6_is_unspecified_addr(&net_ping_ip6)) { + puts("*** ERROR: ping address not given\n"); + return 1; + } + goto common; +#endif #if defined(CONFIG_CMD_DNS) case DNS: if (net_dns_server.s_addr == 0) { |