diff --git a/acinclude.m4 b/acinclude.m4 index 9194de8e7d..c083e27c96 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1185,6 +1185,8 @@ else fi +AC_CHECK_RESOLV_RETRANS + AC_CACHE_VAL(ac_cv_setsockopt_iprecverr, [ AC_MSG_CHECKING([for setsockopt(, SOL_IP, IP_RECVERR)]) diff --git a/src/auth/cellconfig.c b/src/auth/cellconfig.c index 18a286bd41..7cba99a2c4 100644 --- a/src/auth/cellconfig.c +++ b/src/auth/cellconfig.c @@ -1027,6 +1027,18 @@ afsconf_LookupServer(const char *service, const char *protocol, if (!dotcellname) return AFSCONF_NOTFOUND; /* service not found */ +#ifdef HAVE_RES_RETRANSRETRY + if ((_res.options & RES_INIT) == 0 && res_init() == -1) + return (0); + + /* + * Rx timeout is typically 56 seconds; limit user experience to + * similar timeout + */ + _res.retrans = 18; + _res.retry = 3; +#endif + retryafsdb: switch (pass) { case 0: diff --git a/src/cf/ressearch.m4 b/src/cf/ressearch.m4 index c8cc0f4cc1..d2cab435a8 100644 --- a/src/cf/ressearch.m4 +++ b/src/cf/ressearch.m4 @@ -1,3 +1,26 @@ +AC_DEFUN([AC_CHECK_RESOLV_RETRANS],[ + AC_CACHE_CHECK([for retransmit support in res_state], [ac_cv_res_retransretry],[ + AC_TRY_RUN( [ +#include +#if defined(__sun__) +#include +#endif +#include +int main(void) { + _res.retrans = 2; + _res.retry = 1; + exit(0); +} +],[ + ac_cv_res_retransretry=1 +],[ + ac_cv_res_retransretry= +],[ + ac_cv_res_retransretry="no" +])]) +AC_DEFINE_UNQUOTED([HAVE_RES_RETRANSRETRY], [$ac_cv_res_retransretry], [Define if resolv.h's res_state has the fields retrans/rety]) +]) + AC_DEFUN([AC_FUNC_RES_SEARCH], [ ac_cv_func_res_search=no AC_TRY_LINK([