]> 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:53:06 +0000 (10:53 +1000)
Also 'zone' should be initialised to zero.

(cherry picked from commit e7662c4c6347648e95606338ce98f360e5afb5a7)

lib/isc/netscope.c

index bca2d13801afd058ee86d35fbca59e9f1ef29d18..68a0a8dc147c38a487ad73f93c29a4f6df286740 100644 (file)
@@ -18,6 +18,7 @@
 #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) {
@@ -26,9 +27,13 @@ isc_netscope_pton(int af, char *scopename, void *addr, uint32_t *zoneid) {
        unsigned int ifid;
        struct in6_addr *in6;
 #endif /* ifdef HAVE_IF_NAMETOINDEX */
-       uint32_t zone;
+       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);