mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-08-24 15:16:02 +00:00
Fix mdns_resp_del_service
This commit is contained in:
parent
c8b7759e10
commit
e80b2eb4cf
|
@ -1995,11 +1995,11 @@ mdns_resp_remove_netif(struct netif *netif)
|
|||
* @param txt_data Userdata pointer for txt_fn
|
||||
* @return service_id if the service was added to the netif, an err_t otherwise
|
||||
*/
|
||||
err_t
|
||||
s8_t
|
||||
mdns_resp_add_service(struct netif *netif, const char *name, const char *service, enum mdns_sd_proto proto, u16_t port, u32_t dns_ttl, service_get_txt_fn_t txt_fn, void *txt_data)
|
||||
{
|
||||
int i;
|
||||
int slot = -1;
|
||||
s8_t i;
|
||||
s8_t slot = -1;
|
||||
struct mdns_service *srv;
|
||||
struct mdns_host* mdns;
|
||||
|
||||
|
@ -2050,15 +2050,16 @@ mdns_resp_add_service(struct netif *netif, const char *name, const char *service
|
|||
* @return ERR_OK if the service was removed from the netif, an err_t otherwise
|
||||
*/
|
||||
err_t
|
||||
mdns_resp_del_service(struct netif *netif, int slot)
|
||||
mdns_resp_del_service(struct netif *netif, s8_t slot)
|
||||
{
|
||||
struct mdns_host* mdns;
|
||||
struct mdns_service *srv;
|
||||
LWIP_ASSERT("mdns_resp_del_service: netif != NULL", netif);
|
||||
mdns = NETIF_TO_HOST(netif);
|
||||
LWIP_ERROR("mdns_resp_del_service: Not an mdns netif", (mdns != NULL), return ERR_VAL);
|
||||
LWIP_ERROR("mdns_resp_del_service: Invalid Service ID", (slot >= 0) && (slot < MDNS_MAX_SERVICES), return ERR_VAL);
|
||||
LWIP_ERROR("mdns_resp_del_service: Invalid Service ID", (mdns->services[slot] != NULL), return ERR_VAL);
|
||||
|
||||
|
||||
srv = mdns->services[slot];
|
||||
mdns->services[slot] = NULL;
|
||||
mem_free(srv);
|
||||
|
|
|
@ -61,9 +61,10 @@ void mdns_resp_init(void);
|
|||
err_t mdns_resp_add_netif(struct netif *netif, const char *hostname, u32_t dns_ttl);
|
||||
err_t mdns_resp_remove_netif(struct netif *netif);
|
||||
|
||||
err_t mdns_resp_add_service(struct netif *netif, const char *name, const char *service, enum mdns_sd_proto proto, u16_t port, u32_t dns_ttl, service_get_txt_fn_t txt_fn, void *txt_userdata);
|
||||
s8_t mdns_resp_add_service(struct netif *netif, const char *name, const char *service, enum mdns_sd_proto proto, u16_t port, u32_t dns_ttl, service_get_txt_fn_t txt_fn, void *txt_userdata);
|
||||
err_t mdns_resp_del_service(struct netif *netif, s8_t slot);
|
||||
|
||||
err_t mdns_resp_add_service_txtitem(struct mdns_service *service, const char *txt, u8_t txt_len);
|
||||
err_t mdns_resp_del_service(struct netif *netif, int slot);
|
||||
|
||||
void mdns_resp_netif_settings_changed(struct netif *netif);
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user