From ec00670eb7dba716c819fc642f05777b822644de Mon Sep 17 00:00:00 2001 From: ligd Date: Thu, 8 Nov 2018 08:33:13 -0600 Subject: [PATCH] libs/libc/netdb/lib_dnsbind.c: Make DNS recevie timeout configurable. --- libs/libc/netdb/Kconfig | 7 +++++++ libs/libc/netdb/lib_dnsbind.c | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/libs/libc/netdb/Kconfig b/libs/libc/netdb/Kconfig index b54ff676a4..5e51ab3b4e 100644 --- a/libs/libc/netdb/Kconfig +++ b/libs/libc/netdb/Kconfig @@ -54,6 +54,13 @@ menuconfig NETDB_DNSCLIENT if NETDB_DNSCLIENT +config NETDB_DNSCLIENT_RECV_TIMEOUT + int "DNS receive tiemout" + default 30 + ---help--- + This the timeout value when DNS receive response after + dns_send_query, unit: seconds + config NETDB_DNSCLIENT_ENTRIES int "Number of DNS resolver entries" default 0 if DEFAULT_SMALL diff --git a/libs/libc/netdb/lib_dnsbind.c b/libs/libc/netdb/lib_dnsbind.c index 3c1645f7a1..d430b2b683 100644 --- a/libs/libc/netdb/lib_dnsbind.c +++ b/libs/libc/netdb/lib_dnsbind.c @@ -107,7 +107,7 @@ int dns_bind(void) /* Set up a receive timeout */ - tv.tv_sec = 30; + tv.tv_sec = CONFIG_NETDB_DNSCLIENT_RECV_TIMEOUT; tv.tv_usec = 0; ret = setsockopt(sd, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(struct timeval));