]> jfr.im git - irc/atheme/atheme-contrib-modules.git/commitdiff
res_query(3): use C_IN instead of C_ANY master origin/HEAD origin/master
authorAaron Jones <redacted>
Fri, 7 Jul 2023 18:02:22 +0000 (18:02 +0000)
committerAaron Jones <redacted>
Fri, 7 Jul 2023 18:02:22 +0000 (18:02 +0000)
Some resolvers will drop class ANY queries or reply with no data.
Perform an Internet-class query instead.

configure
m4/atheme-contrib-libtest-res-query.m4
src/ns_mxcheck.c
src/ns_mxcheck_async.c

index a48867bd8916646fc8b889825c60404171c97d1f..7f47fac43a292591a56573f0e437e6a2c6e9b24f 100755 (executable)
--- a/configure
+++ b/configure
@@ -4481,8 +4481,8 @@ printf %s "checking whether compiling and linking a program using res_query(3) w
             #ifdef HAVE_RESOLV_H
             #  include <resolv.h>
             #endif
-            #ifndef C_ANY
-            #  define C_ANY ns_c_any
+            #ifndef C_IN
+            #  define C_IN ns_c_in
             #endif
             #ifndef T_MX
             #  define T_MX ns_t_mx
@@ -4496,7 +4496,7 @@ main (void)
 {
 
             ns_msg amsg;
-            const int ret = res_query(NULL, C_ANY, T_MX, NULL, 0);
+            const int ret = res_query(NULL, C_IN, T_MX, NULL, 0);
             (void) ns_initparse(NULL, ret, &amsg);
             const int cnt = ns_msg_count(amsg, S_AN);
 
@@ -4557,8 +4557,8 @@ else $as_nop
             #ifdef HAVE_RESOLV_H
             #  include <resolv.h>
             #endif
-            #ifndef C_ANY
-            #  define C_ANY ns_c_any
+            #ifndef C_IN
+            #  define C_IN ns_c_in
             #endif
             #ifndef T_MX
             #  define T_MX ns_t_mx
@@ -4572,7 +4572,7 @@ main (void)
 {
 
             ns_msg amsg;
-            const int ret = res_query(NULL, C_ANY, T_MX, NULL, 0);
+            const int ret = res_query(NULL, C_IN, T_MX, NULL, 0);
             (void) ns_initparse(NULL, ret, &amsg);
             const int cnt = ns_msg_count(amsg, S_AN);
 
index d6b6c0c87bc06fd77e8f4b1bfbf38989d32823f2..6e82859ef4b46bc02cfc0b2d3cfceffd1a8fc7ab 100644 (file)
@@ -31,8 +31,8 @@ AC_DEFUN([ATHEME_CONTRIB_LIBTEST_RES_QUERY_DRIVER], [
             #ifdef HAVE_RESOLV_H
             #  include <resolv.h>
             #endif
-            #ifndef C_ANY
-            #  define C_ANY ns_c_any
+            #ifndef C_IN
+            #  define C_IN ns_c_in
             #endif
             #ifndef T_MX
             #  define T_MX ns_t_mx
@@ -42,7 +42,7 @@ AC_DEFUN([ATHEME_CONTRIB_LIBTEST_RES_QUERY_DRIVER], [
             #endif
         ]], [[
             ns_msg amsg;
-            const int ret = res_query(NULL, C_ANY, T_MX, NULL, 0);
+            const int ret = res_query(NULL, C_IN, T_MX, NULL, 0);
             (void) ns_initparse(NULL, ret, &amsg);
             const int cnt = ns_msg_count(amsg, S_AN);
         ]])
index 7199d935c5e6eefb386c661488f97a83f6087f73..78c9fd0ad3f0918cf083f0d7e5bed6f4f76e3f90 100644 (file)
@@ -18,8 +18,8 @@
 #  include <resolv.h>
 #endif
 
-#ifndef C_ANY
-#  define C_ANY ns_c_any
+#ifndef C_IN
+#  define C_IN ns_c_in
 #endif
 #ifndef T_MX
 #  define T_MX ns_t_mx
@@ -37,7 +37,7 @@ count_mx(const char *host)
        if (! host || ! *host)
                return 0;
 
-       const int len = res_query(host, C_ANY, T_MX, nsbuf, sizeof nsbuf);
+       const int len = res_query(host, C_IN, T_MX, nsbuf, sizeof nsbuf);
 
        if (len < 0)
                return 0;
index b7bac132fcd5dd820cfcfa9895581a0bb503540c..77ecd7319441c02512a5bc7d46b2220a8f86aa84 100644 (file)
@@ -18,8 +18,8 @@
 #  include <resolv.h>
 #endif
 
-#ifndef C_ANY
-#  define C_ANY ns_c_any
+#ifndef C_IN
+#  define C_IN ns_c_in
 #endif
 #ifndef T_MX
 #  define T_MX ns_t_mx
@@ -48,7 +48,7 @@ count_mx(const char *host)
        if (! host || ! *host)
                return 0;
 
-       const int len = res_query(host, C_ANY, T_MX, nsbuf, sizeof nsbuf);
+       const int len = res_query(host, C_IN, T_MX, nsbuf, sizeof nsbuf);
 
        if (len < 0)
                return 0;