You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
1.6 KiB

  1. --- a/configure.ac
  2. +++ b/configure.ac
  3. @@ -152,6 +152,10 @@ if test "x$found_resolv" != "xyes"; then
  4. AC_MSG_ERROR([Unable to do DNS lookups (libresolv check failed)])
  5. fi
  6. LIBS="${LIBS} ${RESOLV_LIBS}"
  7. +AC_SEARCH_LIBS([res_mkquery], [], [AC_DEFINE([HAVE_RES_MKQUERY], 1, [Define if res_mkquery exists])])
  8. +AC_SEARCH_LIBS([__res_mkquery], [], [AC_DEFINE([HAVE_RES_MKQUERY], 1, [Define if res_mkquery exists])])
  9. +AC_SEARCH_LIBS([res_send], [], [AC_DEFINE([HAVE_RES_SEND], 1, [Define if res_send exists])])
  10. +AC_SEARCH_LIBS([__res_send], [], [AC_DEFINE([HAVE_RES_SEND], 1, [Define if res_send exists])])
  11. dnl *****************************************************************
  12. dnl * *
  13. --- a/src/libs/zbxsysinfo/common/net.c
  14. +++ b/src/libs/zbxsysinfo/common/net.c
  15. @@ -425,6 +425,7 @@ static int dns_query(AGENT_REQUEST *requ
  16. if (-1 == res_init()) /* initialize always, settings might have changed */
  17. return SYSINFO_RET_FAIL;
  18. +#if defined(HAVE_RES_MKQUERY) && defined(HAVE_RES_SEND)
  19. if (-1 == (res = res_mkquery(QUERY, zone, C_IN, type, NULL, 0, NULL, buf, sizeof(buf))))
  20. return SYSINFO_RET_FAIL;
  21. @@ -449,6 +450,11 @@ static int dns_query(AGENT_REQUEST *requ
  22. _res.retry = retry;
  23. res = res_send(buf, res, answer.buffer, sizeof(answer.buffer));
  24. +#else /* defined(HAVE_RES_QUERY) && defined(HAVE_RES_SEND) */
  25. + /* retrand and retry are ignored */
  26. + if (-1 == (res = res_query(zone, C_IN, type, answer.buffer, sizeof(answer.buffer))))
  27. + return SYSINFO_RET_FAIL;
  28. +#endif
  29. _res.retrans = saved_retrans;
  30. _res.retry = saved_retry;