Skip to content

Commit 7e9b45c

Browse files
committed
Fixes issue esp8266#5744
Initialize UdpContext `_pcb->local_ip.type` with `IPADDR_TYPE_ANY` in dual-stack mode.
1 parent 1959311 commit 7e9b45c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

libraries/ESP8266WiFi/src/include/UdpContext.h

+6
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,12 @@ class UdpContext
5151
, _tx_buf_offset(0)
5252
{
5353
_pcb = udp_new();
54+
// Defaults to IPADDR_TYPE_V4 (_pcb initialized with all zeroes)
55+
#if LWIP_IPV4 && LWIP_IPV6
56+
_pcb->local_ip.type = IPADDR_TYPE_ANY;
57+
#elif LWIP_IPV6
58+
_pcb->local_ip.type = IPADDR_TYPE_V6;
59+
#endif
5460
#ifdef LWIP_MAYBE_XCC
5561
_mcast_ttl = 1;
5662
#endif

0 commit comments

Comments
 (0)