netdb: fix may add duplicate DNS servers
struct sockaddr_in
{
sa_family_t sin_family;
in_port_t sin_port;
struct in_addr sin_addr;
uint8_t sin_zero[8];
};
sin_zero is probably a random number.
struct sockaddr_in6
{
sa_family_t sin6_family;
in_port_t sin6_port;
uint32_t sin6_flowinfo;
struct in6_addr sin6_addr;
uint32_t sin6_scope_id;
};
sin6_flowinfo and sin6_scope_id is probably a random number.
Random numbers cause the same server configuration check failed,
so let's initialize it.
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
This commit is contained in:
parent
38858b6cc3
commit
3c3865bce0
1 changed files with 1 additions and 0 deletions
|
|
@ -178,6 +178,7 @@ int dns_foreach_nameserver(dns_callback_t callback, FAR void *arg)
|
|||
}
|
||||
#endif /* CONFIG_NETDB_RESOLVCONF_NONSTDPORT */
|
||||
|
||||
memset(&u, 0, sizeof(u));
|
||||
#ifdef CONFIG_NET_IPv4
|
||||
/* Try to convert the IPv4 address */
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue