Skip to content

Commit 0e0dc7f

Browse files
oddstr13d-a-v
authored andcommitted
core/udp.c:udp_new: Initialize pcb->local_ip.type depending on whether we have IPv4, IPv4+IPv6 or IPv6 networking stack. (#28)
Fixes esp8266/Arduino#5744 Closes esp8266/Arduino#5745
1 parent d2f388b commit 0e0dc7f

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
diff --git a/src/core/udp.c b/src/core/udp.c
2+
index 9d2cb4af..40cdf190 100644
3+
--- a/src/core/udp.c
4+
+++ b/src/core/udp.c
5+
@@ -1233,6 +1233,12 @@ udp_new(void)
6+
#if LWIP_MULTICAST_TX_OPTIONS
7+
udp_set_multicast_ttl(pcb, UDP_TTL);
8+
#endif /* LWIP_MULTICAST_TX_OPTIONS */
9+
+// Defaults to IPADDR_TYPE_V4 (0)
10+
+#if LWIP_IPV4 && LWIP_IPV6
11+
+ pcb->local_ip.type = IPADDR_TYPE_ANY;
12+
+#elif LWIP_IPV6
13+
+ pcb->local_ip.type = IPADDR_TYPE_V6;
14+
+#endif
15+
}
16+
return pcb;
17+
}

0 commit comments

Comments
 (0)