]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
4737. [cleanup] Address Coverity warnings. [RT #46012]
authorMark Andrews <marka@isc.org>
Tue, 26 Sep 2017 13:21:49 +0000 (23:21 +1000)
committerMark Andrews <marka@isc.org>
Tue, 26 Sep 2017 13:21:49 +0000 (23:21 +1000)
CHANGES
bin/named/server.c
lib/irs/getnameinfo.c

diff --git a/CHANGES b/CHANGES
index a4aa85edbb7bc840dce13c19401d753a24e9a3dc..80c6460f95b95e83d247118a4262204931134a98 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,5 @@
+4737.  [cleanup]       Address Coverity warnings. [RT #46012]
+
 4736.  [cleanup]       (a) Added comments to NSEC3-related functions in
                        lib/dns/zone.c.  (b) Refactored NSEC3 salt formatting
                        code.  (c) Minor tweaks to lock and result handling.
index 8361f7c2aed5a83183297187cde6d8cd7aaee030..a220ee13b6e862cab1ea0a07e3dd49b8572f32af 100644 (file)
@@ -1865,6 +1865,7 @@ cleanup:
        return (result);
 }
 
+#ifdef USE_DNSRPS
 typedef struct conf_dnsrps_ctx conf_dnsrps_ctx_t;
 struct conf_dnsrps_ctx {
        isc_result_t    result;
@@ -2088,6 +2089,7 @@ conf_dnsrps(dns_view_t *view, const cfg_obj_t **maps,
        }
        return (ctx.result);
 }
+#endif
 
 static isc_result_t
 configure_rpz_name(dns_view_t *view, const cfg_obj_t *obj, dns_name_t *name,
@@ -2322,23 +2324,22 @@ configure_rpz(dns_view_t *view, const cfg_obj_t **maps,
        if (!cfg_obj_isvoid(sub_obj)) {
                dnsrps_enabled = cfg_obj_asboolean(sub_obj);
        }
-#ifdef USE_DNSRPS
-       if (dnsrps_enabled && librpz == NULL) {
-               cfg_obj_log(rpz_obj, named_g_lctx, DNS_RPZ_ERROR_LEVEL,
-                           "\"dnsrps-enable yes\" but %s",
-                           librpz_lib_open_emsg.c);
-               return (ISC_R_FAILURE);
-       }
-#else
+#ifndef USE_DNSRPS
        if (dnsrps_enabled) {
                cfg_obj_log(rpz_obj, named_g_lctx, DNS_RPZ_ERROR_LEVEL,
                            "\"dnsrps-enable yes\" but"
                            " with `./configure --enable-dnsrps`");
                return (ISC_R_FAILURE);
        }
-#endif
-
+#else
        if (dnsrps_enabled) {
+               if (librpz == NULL) {
+                       cfg_obj_log(rpz_obj, named_g_lctx, DNS_RPZ_ERROR_LEVEL,
+                                   "\"dnsrps-enable yes\" but %s",
+                                   librpz_lib_open_emsg.c);
+                       return (ISC_R_FAILURE);
+               }
+
                /*
                 * Generate the DNS Response Policy Service
                 * configuration string.
@@ -2351,6 +2352,7 @@ configure_rpz(dns_view_t *view, const cfg_obj_t **maps,
                if (result != ISC_R_SUCCESS)
                        return (result);
        }
+#endif
 
        result = dns_rpz_new_zones(&view->rpzs, rps_cstr,
                                   rps_cstr_size, view->mctx,
index 7311657fb9ee1398e87025bfd041e055c17332ad..1134a1acd8e971dfc5c7bc06a65b0d5ed38c2fc0 100644 (file)
@@ -320,7 +320,6 @@ getnameinfo(const struct sockaddr *sa, IRS_GETNAMEINFO_SOCKLEN_T salen,
                case DNS_R_NOVALIDDS:
                case DNS_R_NOVALIDSIG:
                        ERR(EAI_INSECUREDATA);
-                       break;
                default:
                        ERR(EAI_FAIL);
                }