net: wget: let wget_with_dns work with dns disabled

This was marked as TODO in the code:
 - Enable use of wget_with_dns even if CMD_DNS is disabled if
   the given uri has the ip address for the http server.
 - Move the check for CMD_DNS inside wget_with_dns.
 - Rename wget_with_dns to wget_do_request

Signed-off-by: Adriano Cordova <adrianox@gmail.com>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
This commit is contained in:
Adriano Cordova
2024-12-04 00:05:16 -03:00
committed by Heinrich Schuchardt
parent dc7c8a2532
commit 9bab7d2a7c
5 changed files with 29 additions and 20 deletions

View File

@@ -501,13 +501,16 @@ int dhcp_run(ulong addr, const char *fname, bool autoload);
int do_tftpb(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]);
/**
* wget_with_dns() - runs dns host IP address resulution before wget
* wget_do_request() - sends a wget request
*
* Sends a wget request, if DNS resolution is enabled it resolves the
* given uri.
*
* @dst_addr: destination address to download the file
* @uri: uri string of target file of wget
* Return: zero on success, negative if failed
*/
int wget_with_dns(ulong dst_addr, char *uri);
int wget_do_request(ulong dst_addr, char *uri);
/**
* wget_validate_uri() - varidate the uri
*