From 87994d3bb45e001dc2bdbd223b0a23d828dec876 Mon Sep 17 00:00:00 2001 From: Our Air Quality Date: Sat, 19 Aug 2017 14:52:56 +1000 Subject: [PATCH] http_get example: fix compilation with ipv6 disabled. --- examples/http_get/http_get.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/examples/http_get/http_get.c b/examples/http_get/http_get.c index f59aa8e..766dd81 100644 --- a/examples/http_get/http_get.c +++ b/examples/http_get/http_get.c @@ -48,6 +48,7 @@ void http_get_task(void *pvParameters) continue; } +#if LWIP_IPV6 { struct netif *netif = sdk_system_get_netif(0); int i; @@ -57,14 +58,17 @@ void http_get_task(void *pvParameters) printf(" ip6 addr %d = %s\n", i, ip6addr_ntoa(netif_ip6_addr(netif, i))); } } +#endif struct sockaddr *sa = res->ai_addr; if (sa->sa_family == AF_INET) { printf("DNS lookup succeeded. IP=%s\r\n", inet_ntoa(((struct sockaddr_in *)sa)->sin_addr)); } +#if LWIP_IPV6 if (sa->sa_family == AF_INET6) { printf("DNS lookup succeeded. IP=%s\r\n", inet6_ntoa(((struct sockaddr_in6 *)sa)->sin6_addr)); } +#endif int s = socket(res->ai_family, res->ai_socktype, 0); if(s < 0) {