subsys/mgmt/hawkbit: Set `ai_socktype` if IPV4/IPV6

Follows the implementation of updatehub and set the
`ai_socktype` only if IPV4/IPV6

Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
(cherry picked from commit dd9d6bbb44)
This commit is contained in:
Yong Cong Sin 2022-08-17 23:21:05 +08:00 committed by Christopher Friedt
parent 0306e75a5f
commit 8abef50e97
1 changed files with 2 additions and 2 deletions

View File

@ -243,12 +243,12 @@ static bool start_http_client(void)
if (IS_ENABLED(CONFIG_NET_IPV6)) {
hints.ai_family = AF_INET6;
hints.ai_socktype = SOCK_STREAM;
} else if (IS_ENABLED(CONFIG_NET_IPV4)) {
hints.ai_family = AF_INET;
hints.ai_socktype = SOCK_STREAM;
}
hints.ai_socktype = SOCK_STREAM;
while (resolve_attempts--) {
ret = getaddrinfo(CONFIG_HAWKBIT_SERVER, CONFIG_HAWKBIT_PORT,
&hints, &addr);