mirror of
https://github.com/espressif/esp-protocols.git
synced 2025-07-17 12:32:14 +02:00
mdns: Fix wrong mdns source address if lwIP IPv6 zones disabled
The struct definition of ip6_addr_t in lwip and esp_ip6_addr_t differs since zone could be possibly disabled in lwip. Using memcpy to copy the address will cause wrong source address. Copy the entries manually instead. Merges https://github.com/espressif/esp-idf/pull/6055 * Original commit: espressif/esp-idf@7ac97616c1
This commit is contained in:
committed by
suren-gabrielyan-espressif
parent
2cb3a6e35e
commit
fd47df3e30
@ -127,7 +127,8 @@ static void _udp_recv(void *arg, struct udp_pcb *upcb, struct pbuf *pb, const ip
|
|||||||
packet->tcpip_if = MDNS_IF_MAX;
|
packet->tcpip_if = MDNS_IF_MAX;
|
||||||
packet->pb = this_pb;
|
packet->pb = this_pb;
|
||||||
packet->src_port = rport;
|
packet->src_port = rport;
|
||||||
memcpy(&packet->src, raddr, sizeof(ip_addr_t));
|
packet->src.type = raddr->type;
|
||||||
|
memcpy(&packet->src.u_addr, &raddr->u_addr, sizeof(raddr->u_addr));
|
||||||
packet->dest.type = packet->src.type;
|
packet->dest.type = packet->src.type;
|
||||||
|
|
||||||
if (packet->src.type == IPADDR_TYPE_V4) {
|
if (packet->src.type == IPADDR_TYPE_V4) {
|
||||||
|
Reference in New Issue
Block a user