]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Mark 'addr' as unused if HAVE_IF_NAMETOINDEX is not defined
authorMark Andrews <marka@isc.org>
Thu, 9 Jul 2020 05:04:31 +0000 (15:04 +1000)
committerMark Andrews <marka@isc.org>
Tue, 14 Jul 2020 00:55:17 +0000 (10:55 +1000)
Also 'zone' should be initialised to zero.

(cherry picked from commit e7662c4c6347648e95606338ce98f360e5afb5a7)

lib/isc/netscope.c

index 1c51d35eafa5e7e25361971e4d08fde58a844281..9e6b4bca9fca62cff159a96a9dcd51cb80def3b6 100644 (file)
 
 #include <config.h>
 
-#include <isc/string.h>
 #include <isc/net.h>
 #include <isc/netscope.h>
 #include <isc/result.h>
+#include <isc/string.h>
+#include <isc/util.h>
 
 isc_result_t
 isc_netscope_pton(int af, char *scopename, void *addr, uint32_t *zoneid) {
@@ -24,10 +25,14 @@ isc_netscope_pton(int af, char *scopename, void *addr, uint32_t *zoneid) {
 #ifdef ISC_PLATFORM_HAVEIFNAMETOINDEX
        unsigned int ifid;
        struct in6_addr *in6;
-#endif
-       uint32_t zone;
+#endif /* ifdef HAVE_IF_NAMETOINDEX */
+       uint32_t zone = 0;
        uint64_t llz;
 
+#ifndef HAVE_IF_NAMETOINDEX
+       UNUSED(addr);
+#endif
+
        /* at this moment, we only support AF_INET6 */
        if (af != AF_INET6)
                return (ISC_R_FAILURE);