net: Move env_get_ip() out of the header file

This function requires access to env.h but it is a lot to include just
for the env_get() function. It eventually pulls in linux/byteorder which
causes a conflict with exfat which has its own byteorder functions.

Move the function to a C file instead.

Add includes to some other files to keep the build working.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
This commit is contained in:
Simon Glass
2025-04-30 19:04:47 -06:00
parent 51274baaf5
commit 84d7727765
2 changed files with 7 additions and 5 deletions

View File

@@ -1,4 +1,5 @@
// SPDX-License-Identifier: GPL-2.0
#include <env.h>
#include <net-common.h>
void copy_filename(char *dst, const char *src, int size)
@@ -25,3 +26,8 @@ int wget_request(ulong dst_addr, char *uri, struct wget_http_info *info)
wget_info = info ? info : &default_wget_info;
return wget_with_dns(dst_addr, uri);
}
struct in_addr env_get_ip(char *var)
{
return string_to_ip(env_get(var));
}