mirror of
https://github.com/espressif/esp-protocols.git
synced 2025-07-18 13:02:21 +02:00
examples: common connect: fix build error if ipv6 disabled
Declaration of local variable esp_ip6_addr_t ip6[]; was active even if IPV6 disabled in sdkconfig. Introduced in 62e39adff8db0605875fe7103c8919fbfe229f20 * Original commit: espressif/esp-idf@5c6bca69a5
This commit is contained in:
committed by
suren-gabrielyan-espressif
parent
12fb6d8e15
commit
f1f6c5de05
@ -167,7 +167,6 @@ esp_err_t example_connect(void)
|
|||||||
// iterate over active interfaces, and print out IPs of "our" netifs
|
// iterate over active interfaces, and print out IPs of "our" netifs
|
||||||
esp_netif_t *netif = NULL;
|
esp_netif_t *netif = NULL;
|
||||||
esp_netif_ip_info_t ip;
|
esp_netif_ip_info_t ip;
|
||||||
esp_ip6_addr_t ip6[MAX_IP6_ADDRS_PER_NETIF];
|
|
||||||
for (int i=0; i<esp_netif_get_nr_of_ifs(); ++i) {
|
for (int i=0; i<esp_netif_get_nr_of_ifs(); ++i) {
|
||||||
netif = esp_netif_next(netif);
|
netif = esp_netif_next(netif);
|
||||||
if (is_our_netif(TAG, netif)) {
|
if (is_our_netif(TAG, netif)) {
|
||||||
@ -176,6 +175,7 @@ esp_err_t example_connect(void)
|
|||||||
|
|
||||||
ESP_LOGI(TAG, "- IPv4 address: " IPSTR, IP2STR(&ip.ip));
|
ESP_LOGI(TAG, "- IPv4 address: " IPSTR, IP2STR(&ip.ip));
|
||||||
#ifdef CONFIG_EXAMPLE_CONNECT_IPV6
|
#ifdef CONFIG_EXAMPLE_CONNECT_IPV6
|
||||||
|
esp_ip6_addr_t ip6[MAX_IP6_ADDRS_PER_NETIF];
|
||||||
int ip6_addrs = esp_netif_get_all_ip6(netif, ip6);
|
int ip6_addrs = esp_netif_get_all_ip6(netif, ip6);
|
||||||
for (int j=0; j< ip6_addrs; ++j) {
|
for (int j=0; j< ip6_addrs; ++j) {
|
||||||
esp_ip6_addr_type_t ipv6_type = esp_netif_ip6_get_addr_type(&(ip6[j]));
|
esp_ip6_addr_type_t ipv6_type = esp_netif_ip6_get_addr_type(&(ip6[j]));
|
||||||
|
Reference in New Issue
Block a user