From cd511ce6a5af30ae0d2b42c028471131f311f920 Mon Sep 17 00:00:00 2001 From: suvendhu Date: Fri, 24 Mar 2023 14:07:25 +0530 Subject: [PATCH] Fix use IPv4 address only when v6 is disabled --- http.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/http.c b/http.c index 752fd9d..049526b 100644 --- a/http.c +++ b/http.c @@ -98,6 +98,8 @@ int http_client_init(struct cwmp *cwmp) int tmp = inet_pton(AF_INET, ip, buf); cwmp_uci_set_value("cwmp", "acs", "ip_version", (tmp == 1) ? "4" : "6"); + } else { + curl_easy_setopt(curl, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4); } return 0; }