AC_CHECK_FUNC(setsockopt, ,
[AC_SEARCH_LIBS([setsockopt], [socket xnet])])
+AC_SEARCH_LIBS([setsockopt], [socket xnet])
+AC_SEARCH_LIBS([res_init], [resolv], , , [-lsocket -lnsl])
+AC_CHECK_FUNCS(res_init __res_init)
+
AC_HEADER_STDC
AC_CHECK_HEADERS(bstring.h)
AC_CHECK_HEADER(dns_sd.h,
status = get_multiple_netnums(curr_peer->addr->address,
&peeraddr, &res, 0, t_UNK);
+#if 0 /* Hack for debugging Deferred DNS */
+ if (status == 1) {
+ /* Deferring everything breaks refclocks. */
+ memcpy(&peeraddr, res->ai_addr, res->ai_addrlen);
+ if (!ISREFCLOCKADR(&peeraddr)) {
+ status = 0; /* force deferred DNS path */
+ msyslog(LOG_INFO, "Forcing Deferred DNS for %s, %s",
+ curr_peer->addr->address, stoa(&peeraddr));
+ } else {
+ msyslog(LOG_INFO, "NOT Deferred DNS for %s, %s",
+ curr_peer->addr->address, stoa(&peeraddr));
+ }
+ }
+#endif
+
/* I don't know why getnetnum would return -1.
* The old code had this test, so I guess it must be
* useful
* resolution later
*/
else if (status != 1) {
+ msyslog(LOG_INFO, "Deferring DNS for %s", curr_peer->addr->address);
save_resolve(curr_peer->addr->address,
hmode,
curr_peer->peerversion,
# include <sys/param.h> /* MAXHOSTNAMELEN (often) */
#endif
+#if defined(HAVE_RES_INIT) || defined(HAVE___RES_INIT)
+#include <resolv.h>
+#endif
+
#include <isc/net.h>
#include <isc/result.h>
}
if (entry->ce_name) {
+ if (0) msyslog(LOG_INFO, "findhostaddr: Trying %s", entry->ce_name);
DPRINTF(2, ("findhostaddr: Resolving <%s>\n",
entry->ce_name));
*/
if (!ipv6_works)
hints.ai_family = AF_INET;
-
error = getaddrinfo(entry->ce_name, NULL, &hints, &addr);
if (error == 0) {
entry->peer_store = *((sockaddr_u *)(addr->ai_addr));
case INFO_ERR_IMPL:
msyslog(LOG_ERR,
- "ntpd reports implementation mismatch!");
+ "ntp_intres.request: implementation mismatch");
return 0;
case INFO_ERR_REQ:
msyslog(LOG_ERR,
- "ntpd says configuration request is unknown!");
+ "ntp_intres.request: request unknown");
return 0;
case INFO_ERR_FMT:
msyslog(LOG_ERR,
- "ntpd indicates a format error occurred!");
+ "ntp_intres.request: format error");
return 0;
case INFO_ERR_NODATA:
msyslog(LOG_ERR,
- "ntpd indicates no data available!");
+ "ntp_intres.request: no data available");
return 0;
case INFO_ERR_AUTH:
msyslog(LOG_ERR,
- "ntpd returns a permission denied error!");
+ "ntp_intres.request: permission denied");
return 0;
default:
msyslog(LOG_ERR,
- "ntpd returns unknown error code %d!", n);
+ "ntp_intres.request: unknown error code %d", n);
return 0;
}
}
dores ? "with" : "without" );
#endif
+#if defined(HAVE_RES_INIT) || defined(HAVE___RES_INIT)
+ if (dores) res_init(); /* Reload /etc/resolv.conf - bug 1226 */
+#endif
ce = confentries;
while (ce != NULL) {
#ifdef DEBUG
removeentry(ceremove);
continue;
}
+ // Failed case. Should bump counter and give up.
#ifdef DEBUG
if (debug > 1) {
msyslog(LOG_INFO,