[PATCH 15/19] commands: introduce CMD_HOST
Holger Schurig
holgerschurig at gmail.com
Tue May 13 01:28:55 PDT 2014
... because NET_RESOLV can be used alone to turn on the functionality
of resolv().
Signed-off-by: Holger Schurig <holgerschurig at gmail.com>
---
commands/Kconfig | 9 +++++++++
net/dns.c | 3 ++-
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/commands/Kconfig b/commands/Kconfig
index 2f24cd5..966d5fd 100644
--- a/commands/Kconfig
+++ b/commands/Kconfig
@@ -1052,6 +1052,15 @@ if NET
menu "Network"
+config CMD_HOST
+ tristate
+ select NET_RESOLV
+ prompt "host"
+ help
+ Resolv a hostname.
+
+ Usage: host DESTINATION
+
config CMD_MIITOOL
tristate
depends on PHYLIB
diff --git a/net/dns.c b/net/dns.c
index 4506baf..0a8ce8b 100644
--- a/net/dns.c
+++ b/net/dns.c
@@ -241,6 +241,7 @@ IPaddr_t resolv(char *host)
return dns_ip;
}
+#ifdef CONFIG_CMD_HOST
static int do_host(int argc, char *argv[])
{
IPaddr_t ip;
@@ -266,4 +267,4 @@ BAREBOX_CMD_START(host)
BAREBOX_CMD_OPTS("HOSTNAME")
BAREBOX_CMD_GROUP(CMD_GRP_NET)
BAREBOX_CMD_END
-
+#endif
--
1.7.10.4
More information about the barebox
mailing list