mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-10-02 14:23:19 +08:00
chore: align getaddrinfo hints copy flow
This commit is contained in:
@@ -7058,6 +7058,7 @@ sysret_t sys_getaddrinfo(const char *nodename,
|
||||
char *k_nodename = NULL;
|
||||
char *k_servname = NULL;
|
||||
struct addrinfo *k_hints = NULL;
|
||||
struct musl_addrinfo k_hints_musl;
|
||||
struct musl_addrinfo k_res_musl;
|
||||
struct musl_sockaddr *u_res_ai_addr = NULL;
|
||||
#ifdef ARCH_MM_MMU
|
||||
@@ -7153,7 +7154,6 @@ sysret_t sys_getaddrinfo(const char *nodename,
|
||||
|
||||
if (hints)
|
||||
{
|
||||
struct musl_addrinfo k_hints_musl;
|
||||
#ifdef ARCH_MM_MMU
|
||||
if (!lwp_user_accessable((void *)hints, sizeof(struct musl_addrinfo)))
|
||||
{
|
||||
@@ -7214,8 +7214,8 @@ sysret_t sys_getaddrinfo(const char *nodename,
|
||||
if (hints != NULL)
|
||||
{
|
||||
/* copy socktype & protocol from hints if specified */
|
||||
k_res_musl.ai_socktype = k_hints->ai_socktype;
|
||||
k_res_musl.ai_protocol = k_hints->ai_protocol;
|
||||
k_res_musl.ai_socktype = k_hints_musl.ai_socktype;
|
||||
k_res_musl.ai_protocol = k_hints_musl.ai_protocol;
|
||||
}
|
||||
|
||||
#ifdef ARCH_MM_MMU
|
||||
|
||||
Reference in New Issue
Block a user