mirror of
https://github.com/espressif/esp-protocols.git
synced 2025-07-30 02:37:31 +02:00
mdns: always send A/AAAA records in announcements
* Original commit: espressif/esp-idf@456f80b754
This commit is contained in:
committed by
suren-gabrielyan-espressif
parent
7e82a7cef7
commit
7dd0bc1fff
@ -1850,7 +1850,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)
|
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);
|
mdns_tx_packet_t * packet = _mdns_alloc_packet_default(probe->tcpip_if, probe->ip_protocol);
|
||||||
if (!packet) {
|
if (!packet) {
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -1867,6 +1866,12 @@ static mdns_tx_packet_t * _mdns_create_announce_from_probe(mdns_tx_packet_t * pr
|
|||||||
_mdns_free_tx_packet(packet);
|
_mdns_free_tx_packet(packet);
|
||||||
return NULL;
|
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) {
|
} 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)) {
|
if (!_mdns_alloc_answer(&packet->answers, s->type, NULL, s->host, true, false)) {
|
||||||
|
Reference in New Issue
Block a user