From a8755b8530bc836b17bc1e94af49077d6f4e18b5 Mon Sep 17 00:00:00 2001 From: Dirk Ziegelmeier Date: Tue, 2 Jan 2018 10:59:20 +0100 Subject: [PATCH] Work on bug #52770: mdns: move the announcements to a timer callback Don't automatically announce when adding netifs/services --- UPGRADING | 3 +++ src/apps/mdns/mdns.c | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/UPGRADING b/UPGRADING index 2549ffc4..9298e949 100644 --- a/UPGRADING +++ b/UPGRADING @@ -10,6 +10,9 @@ with newer versions. ++ Application changes: + * MDNS: Functions mdns_resp_add_netif() and mdns_resp_add_service() do not automatically announce + any more. Users need to call mdns_resp_announce() after adding netifs or services. + * TCP only kills existing connections with a LOWER priority than the one currently being opened. Previous implementations also kill existing connections of the SAME priority. diff --git a/src/apps/mdns/mdns.c b/src/apps/mdns/mdns.c index 92cd3980..61061f70 100644 --- a/src/apps/mdns/mdns.c +++ b/src/apps/mdns/mdns.c @@ -1877,6 +1877,7 @@ mdns_netif_ext_status_callback(struct netif *netif, netif_nsc_reason_t reason, c /** * @ingroup mdns * Activate MDNS responder for a network interface and send announce packets. + * Don't forget to call mdns_resp_announce() after you added all netifs and services. * @param netif The network interface to activate. * @param hostname Name to use. Queries for <hostname>.local will be answered * with the IP addresses of the netif. The hostname will be copied, the @@ -1916,7 +1917,6 @@ mdns_resp_add_netif(struct netif *netif, const char *hostname, u32_t dns_ttl) } #endif - mdns_resp_announce(netif); return ERR_OK; cleanup: @@ -1965,6 +1965,7 @@ mdns_resp_remove_netif(struct netif *netif) /** * @ingroup mdns * Add a service to the selected network interface. + * Don't forget to call mdns_resp_announce() after you added all services. * @param netif The network interface to publish this service on * @param name The name of the service * @param service The service type, like "_http" @@ -2014,7 +2015,6 @@ mdns_resp_add_service(struct netif *netif, const char *name, const char *service mdns->services[slot] = srv; - mdns_resp_announce(netif); return slot; } @@ -2068,7 +2068,7 @@ mdns_resp_add_service_txtitem(struct mdns_service *service, const char *txt, u8_ void mdns_resp_announce(struct netif *netif) { - LWIP_ERROR("mdns_resp_netif_ip_changed: netif != NULL", (netif != NULL), return); + LWIP_ERROR("mdns_resp_announce: netif != NULL", (netif != NULL), return); if (NETIF_TO_HOST(netif) == NULL) { return;