5 Commits

Author SHA1 Message Date
Jerome Forissier
512be89796 net: introduce CONFIG_DNS
Introduce the DNS Kconfig symbol so that various network commands may
use host names without the dns command (CMD_DNS) being selected.

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
CC: E Shattow <e@freeshell.de>
2025-08-18 15:47:58 +02:00
Jerome Forissier
1361d9f4f0 lwip: dns: do not print IP address when a variable is specified
When calling "dns <hostname> <varname>", do not print out the IP address
of <hostname> onto the console. Print it only when no variable is
passed. The reason is to be able to call do_dns() from another command
in need of the DNS services without polluting the output.

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
2025-07-08 11:07:37 +02:00
Jerome Forissier
d3136d22a6 lwip: dns: do not return CMD_RET_FAILURE on successful resolution
The DNS loop checks for a non-zero IP address after DNS resolution, but
the address is in fact never copied into the context. Fix that.

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
2025-07-08 11:07:37 +02:00
Jerome Forissier
ba814b8b5a lwip: split cmd/net-lwip.c into one file per command
Move each command in cmd/net-lwip.c into its own file
(cmd/lwip/${cmd}.c).

Suggested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
2025-07-08 11:07:37 +02:00
Jerome Forissier
1c55e0370b lwip: move net/lwip/dns.c to cmd/lwip
Prepare to split the dns command from cmd/net-lwip.c by moving the
implementation from net/lwip/dns.c to cmd/lwip.

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
2025-07-08 11:07:37 +02:00