mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
examples: Minor fixes in udp_nulticast socket examples
Make sure that IPv6 mapped IPv4 addresses are not used when using vanilla lwip
This commit is contained in:
parent
5b471a1848
commit
b0e4ae4a5e
@ -8,7 +8,7 @@ The behaviour of the example is:
|
||||
|
||||
* Listens to specified multicast addresses (one IPV4 and/or one IPV6).
|
||||
* Print any UDP packets received as ASCII text.
|
||||
* If no packets are received it will periodicially (after 2.5 seconds) send its own plaintext packet(s) to the multicast address(es).
|
||||
* If no packets are received it will periodically (after 2.5 seconds) send its own plaintext packet(s) to the multicast address(es).
|
||||
|
||||
## Configuration
|
||||
|
||||
|
@ -417,8 +417,12 @@ static void mcast_example_task(void *pvParameters)
|
||||
#ifdef CONFIG_EXAMPLE_IPV4_ONLY
|
||||
hints.ai_family = AF_INET; // For an IPv4 socket
|
||||
#else
|
||||
|
||||
#ifdef CONFIG_ESP_NETIF_TCPIP_LWIP // Resolving IPv4 mapped IPv6 addresses is supported only in the official TCPIP_LWIP stack (esp-lwip)
|
||||
hints.ai_family = AF_INET6; // For an IPv4 socket with V4 mapped addresses
|
||||
hints.ai_flags |= AI_V4MAPPED;
|
||||
#endif // CONFIG_ESP_NETIF_TCPIP_LWIP
|
||||
|
||||
#endif
|
||||
int err = getaddrinfo(CONFIG_EXAMPLE_MULTICAST_IPV4_ADDR,
|
||||
NULL,
|
||||
|
Loading…
x
Reference in New Issue
Block a user