Skip to content

Commit dd47630

Browse files
committed
Merge branch 'feature/add_macro_to_disable_esp_tlc_ipv6' into 'master'
Add macro to disable ipv6 configuration See merge request sdk/ESP8266_RTOS_SDK!674
2 parents ebecf5d + 98e7dfa commit dd47630

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

components/esp-tls/esp_tls.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@
2323
#include "esp_tls.h"
2424
#include <errno.h>
2525

26+
#if LWIP_IPV6
27+
#define ESP_TLS_IPV6
28+
#endif
29+
2630
static const char *TAG = "esp-tls";
2731
static mbedtls_x509_crt *global_cacert = NULL;
2832

@@ -101,11 +105,13 @@ static int esp_tcp_connect(const char *host, int hostlen, int port, int *sockfd,
101105
struct sockaddr_in *p = (struct sockaddr_in *)res->ai_addr;
102106
p->sin_port = htons(port);
103107
addr_ptr = p;
108+
#ifdef ESP_TLS_IPV6
104109
} else if (res->ai_family == AF_INET6) {
105110
struct sockaddr_in6 *p = (struct sockaddr_in6 *)res->ai_addr;
106111
p->sin6_port = htons(port);
107112
p->sin6_family = AF_INET6;
108113
addr_ptr = p;
114+
#endif
109115
} else {
110116
ESP_LOGE(TAG, "Unsupported protocol family %d", res->ai_family);
111117
goto err_freesocket;

0 commit comments

Comments
 (0)