Merge branch 'fix/fix_esp_tls_ipv6_only_build_issue' into 'master'

fix(esp-tls): Fixed build issue in esp-tls related to IPV6 only config

See merge request espressif/esp-idf!38722
This commit is contained in:
Mahavir Jain
2025-04-24 22:04:15 +08:00
2 changed files with 6 additions and 1 deletions

View File

@@ -378,9 +378,12 @@ static inline esp_err_t tcp_connect(const char *host, int hostlen, int port, con
ret = ESP_ERR_ESP_TLS_FAILED_CONNECT_TO_HOST;
ESP_LOGD(TAG, "[sock=%d] Connecting to server. HOST: %s, Port: %d", fd, host, port);
#if IPV6_ENABLED
#if IPV4_ENABLED && IPV6_ENABLED
socklen_t addr_len = (address.ss_family == AF_INET) ? sizeof(struct sockaddr_in) : sizeof(struct sockaddr_in6);
#elif IPV6_ENABLED
socklen_t addr_len = sizeof(struct sockaddr_in6);
#else
/* IPv4 only */
socklen_t addr_len = sizeof(struct sockaddr_in);
#endif
if (connect(fd, (struct sockaddr *)&address, addr_len) < 0) {

View File

@@ -59,6 +59,8 @@ examples/protocols/http_server:
reason: only test on these targets
depends_components+:
- esp_http_server
- esp-tls
- esp_netif
examples/protocols/http_server/async_handlers:
<<: *default_rules