Skip to content

Commit ea78d06

Browse files
committed
Merge branch 'bugfix/example_common_connect_no_ip6' into 'master'
examples: common connect: fix build error if ipv6 disabled See merge request espressif/esp-idf!8877
2 parents 0d90861 + 5c6bca6 commit ea78d06

File tree

1 file changed

+1
-1
lines changed
  • examples/common_components/protocol_examples_common

1 file changed

+1
-1
lines changed

examples/common_components/protocol_examples_common/connect.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,6 @@ esp_err_t example_connect(void)
167167
// iterate over active interfaces, and print out IPs of "our" netifs
168168
esp_netif_t *netif = NULL;
169169
esp_netif_ip_info_t ip;
170-
esp_ip6_addr_t ip6[MAX_IP6_ADDRS_PER_NETIF];
171170
for (int i=0; i<esp_netif_get_nr_of_ifs(); ++i) {
172171
netif = esp_netif_next(netif);
173172
if (is_our_netif(TAG, netif)) {
@@ -176,6 +175,7 @@ esp_err_t example_connect(void)
176175

177176
ESP_LOGI(TAG, "- IPv4 address: " IPSTR, IP2STR(&ip.ip));
178177
#ifdef CONFIG_EXAMPLE_CONNECT_IPV6
178+
esp_ip6_addr_t ip6[MAX_IP6_ADDRS_PER_NETIF];
179179
int ip6_addrs = esp_netif_get_all_ip6(netif, ip6);
180180
for (int j=0; j< ip6_addrs; ++j) {
181181
esp_ip6_addr_type_t ipv6_type = esp_netif_ip6_get_addr_type(&(ip6[j]));

0 commit comments

Comments
 (0)