Skip to content

Commit

Permalink
mdns: always send A/AAAA records in announcements
Browse files Browse the repository at this point in the history
  • Loading branch information
gjc13 committed Dec 7, 2021
1 parent fcd634f commit 456f80b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion components/mdns/mdns.c
Expand Up @@ -1837,7 +1837,6 @@ static mdns_tx_packet_t * _mdns_create_announce_packet(mdns_if_t tcpip_if, mdns_
*/
static mdns_tx_packet_t * _mdns_create_announce_from_probe(mdns_tx_packet_t * probe)
{

mdns_tx_packet_t * packet = _mdns_alloc_packet_default(probe->tcpip_if, probe->ip_protocol);
if (!packet) {
return NULL;
Expand All @@ -1854,6 +1853,12 @@ static mdns_tx_packet_t * _mdns_create_announce_from_probe(mdns_tx_packet_t * pr
_mdns_free_tx_packet(packet);
return NULL;
}
mdns_host_item_t *host = mdns_get_host_item(s->service->hostname);
if (!_mdns_alloc_answer(&packet->answers, MDNS_TYPE_A, NULL, host, true, false)
|| !_mdns_alloc_answer(&packet->answers, MDNS_TYPE_AAAA, NULL, host, true, false)) {
_mdns_free_tx_packet(packet);
return NULL;
}

} else if (s->type == MDNS_TYPE_A || s->type == MDNS_TYPE_AAAA) {
if (!_mdns_alloc_answer(&packet->answers, s->type, NULL, s->host, true, false)) {
Expand Down

0 comments on commit 456f80b

Please sign in to comment.