fix(mdns): Fix wrong "truncated AAAA" error

This commit is contained in:
Andreas K
2026-06-09 07:53:41 +02:00
parent b783c4de40
commit fc5e678726
+3 -3
View File
@@ -293,12 +293,12 @@ void static dbg_packet(const uint8_t *data, size_t len)
}
dbg_printf("\n");
} else if (type == MDNS_TYPE_AAAA) {
if (data_len < sizeof(esp_ip6_addr_t)) {
if (data_len < MDNS_ANSWER_AAAA_SIZE) {
dbg_printf("ERROR: truncated AAAA\n");
continue;
}
esp_ip6_addr_t ip6;
memcpy(&ip6, data_ptr, sizeof(esp_ip6_addr_t));
esp_ip6_addr_t ip6 = {0};
memcpy(&ip6.addr, data_ptr, MDNS_ANSWER_AAAA_SIZE);
dbg_printf(IPV6STR "\n", IPV62STR(ip6));
} else if (type == MDNS_TYPE_A) {
if (data_len < sizeof(esp_ip4_addr_t)) {