No documentation yet. This allows me to test the code on a
non-uClibc system:
$ make makefiles "CCARGS=$CCARGS -DNO_RES_SEND"
It will log a warning and will temporarily set dns_ncache_ttl_fix=no,
so that the warning is logged once per process lifetime.
Wietse
diff -ur /var/tmp/postfix-3.5-20190427/src/dns/dns_lookup.c src/dns/dns_lookup.c
--- /var/tmp/postfix-3.5-20190427/src/dns/dns_lookup.c 2017-12-20
20:48:39.000000000 -0500
+++ src/dns/dns_lookup.c 2019-05-05 10:47:40.378953258 -0400
@@ -305,6 +305,7 @@
* information, but that will have to wait until it is safe to make
* libunbound a mandatory dependency for Postfix.
*/
+#ifdef HAVE_RES_SEND
/* dns_res_query - a res_query() clone that can return negative replies */
@@ -371,6 +372,8 @@
}
}
+#endif
+
/* dns_res_search - res_search() that can return negative replies */
static int dns_res_search(const char *name, int class, int type,
@@ -474,8 +477,16 @@
_res.options &= ~saved_options;
_res.options |= flags;
if (keep_notfound && var_dns_ncache_ttl_fix) {
+#ifdef HAVE_RES_SEND
len = dns_res_query((char *) name, C_IN, type, reply->buf,
reply->buf_len);
+#else
+ var_dns_ncache_ttl_fix = 0;
+ msg_warn("system library does not support %s=yes"
+ " -- ignoring this setting", VAR_DNS_NCACHE_TTL_FIX);
+ len = dns_res_search((char *) name, C_IN, type, reply->buf,
+ reply->buf_len, keep_notfound);
+#endif
} else {
len = dns_res_search((char *) name, C_IN, type, reply->buf,
reply->buf_len, keep_notfound);
diff -ur /var/tmp/postfix-3.5-20190427/src/util/sys_defs.h src/util/sys_defs.h
--- /var/tmp/postfix-3.5-20190427/src/util/sys_defs.h 2019-03-10
12:58:04.000000000 -0400
+++ src/util/sys_defs.h 2019-05-05 10:42:42.433974596 -0400
@@ -1315,6 +1315,12 @@
#endif
#define OPTIND (optind > 0 ? optind : 1)
+#if !defined(__UCLIBC__) && !defined(NO_RES_SEND)
+#define HAVE_RES_SEND
+#else
+#undef HAVE_RES_SEND
+#endif
+
/*
* Check for required but missing definitions.
*/