From e7662c4c6347648e95606338ce98f360e5afb5a7 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Thu, 9 Jul 2020 15:04:31 +1000 Subject: [PATCH] Mark 'addr' as unused if HAVE_IF_NAMETOINDEX is not defined Also 'zone' should be initialised to zero. --- lib/isc/netscope.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/isc/netscope.c b/lib/isc/netscope.c index bca2d13801..68a0a8dc14 100644 --- a/lib/isc/netscope.c +++ b/lib/isc/netscope.c @@ -18,6 +18,7 @@ #include #include #include +#include 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);