libs/libc/netdb: add dns clear interface

Signed-off-by: chao.an <anchao@xiaomi.com>
This commit is contained in:
chao.an
2021-05-24 22:02:44 +08:00
committed by Xiang Xiao
parent 2fd25d7ea7
commit f3a5aee7d7
3 changed files with 43 additions and 0 deletions
+25
View File
@@ -164,6 +164,31 @@ void dns_save_answer(FAR const char *hostname,
dns_semgive();
}
/****************************************************************************
* Name: dns_clear_answer
*
* Description:
* Clear the resolved hostname in the DNS cache
*
* Returned Value:
* None
*
****************************************************************************/
void dns_clear_answer(void)
{
/* Get exclusive access to the DNS cache */
dns_semtake();
/* Reset the circular of DNS cache */
g_dns_head = 0;
g_dns_tail = 0;
dns_semgive();
}
/****************************************************************************
* Name: dns_find_answer
*