Skip to content

Commit 48c157b

Browse files
committed
mdns: fix build issue with CONFIG_LWIP_IPV6 disabled
1 parent 444fae9 commit 48c157b

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

components/mdns/idf_component.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: "1.0.5"
1+
version: "1.0.6"
22
description: mDNS
33
dependencies:
44
idf:

components/mdns/mdns_networking_lwip.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,8 +339,12 @@ size_t _mdns_udp_pcb_write(mdns_if_t tcpip_if, mdns_ip_protocol_t ip_protocol, c
339339
memcpy((uint8_t *)pbt->payload, data, len);
340340

341341
ip_addr_t ip_add_copy;
342+
#if CONFIG_LWIP_IPV6
342343
ip_add_copy.type = ip->type;
343-
memcpy(&(ip_add_copy.u_addr),&(ip->u_addr),sizeof(ip_add_copy.u_addr));
344+
memcpy(&(ip_add_copy.u_addr), &(ip->u_addr), sizeof(ip_add_copy.u_addr));
345+
#else
346+
memcpy(&(ip_add_copy.addr), &(ip->u_addr), sizeof(ip_addr_copy.addr));
347+
#endif // CONFIG_LWIP_IPV6
344348

345349
mdns_api_call_t msg = {
346350
.tcpip_if = tcpip_if,

0 commit comments

Comments
 (0)