]> granicus.if.org Git - esp-idf/commitdiff
mdns: Minor fix for mdns_service_remove()
authorPiyush Shah <piyush@espressif.com>
Thu, 12 Jul 2018 13:45:02 +0000 (19:15 +0530)
committerPiyush Shah <piyush@espressif.com>
Thu, 12 Jul 2018 13:48:54 +0000 (19:18 +0530)
Send the Goodbye packet while removing an mDNS service as an "Authoritative" packet so
that the listeners remove the service from their records immediately.

components/mdns/mdns.c

index 9fb64777e293e822911b191b8be1276093720bfe..6ffebf663e04d79c63b969688d6acf7052cae222 100644 (file)
@@ -1419,6 +1419,7 @@ static void _mdns_pcb_send_bye(tcpip_adapter_if_t tcpip_if, mdns_ip_protocol_t i
     if (!packet) {
         return;
     }
+    packet->flags = MDNS_FLAGS_AUTHORITATIVE;
     size_t i;
     for (i=0; i<len; i++) {
         if (!_mdns_alloc_answer(&packet->answers, MDNS_TYPE_PTR, services[i]->service, true, true)) {