From: Mark Andrews Date: Tue, 26 Nov 2002 03:16:31 +0000 (+0000) Subject: ensure that zone id is set to zero. X-Git-Tag: v9.2.3rc1~104^2~223 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=aebe37a4619864fa0d1a083f3e5171bb3b6e116f;p=thirdparty%2Fbind9.git ensure that zone id is set to zero. only look for BSD internal scope if platform supports scope_id. reviewer: marka developer: jinmei --- diff --git a/lib/isc/unix/interfaceiter.c b/lib/isc/unix/interfaceiter.c index c246e6a0bab..498362effe3 100644 --- a/lib/isc/unix/interfaceiter.c +++ b/lib/isc/unix/interfaceiter.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: interfaceiter.c,v 1.29 2002/10/28 02:16:21 marka Exp $ */ +/* $Id: interfaceiter.c,v 1.30 2002/11/26 03:16:31 marka Exp $ */ #include @@ -63,6 +63,9 @@ static void get_addr(unsigned int family, isc_netaddr_t *dst, struct sockaddr *src) { struct sockaddr_in6 *sa6; + /* clear any remaining value for safety */ + memset(dst, 0, sizeof(*dst)); + dst->family = family; switch (family) { case AF_INET: @@ -77,9 +80,7 @@ get_addr(unsigned int family, isc_netaddr_t *dst, struct sockaddr *src) { #ifdef ISC_PLATFORM_HAVESCOPEID if (sa6->sin6_scope_id != 0) isc_netaddr_setzone(dst, sa6->sin6_scope_id); - else -#endif - { + else { /* * BSD variants embed scope zone IDs in the 128bit * address as a kernel internal form. Unfortunately, @@ -105,6 +106,7 @@ get_addr(unsigned int family, isc_netaddr_t *dst, struct sockaddr *src) { } } } +#endif break; default: INSIST(0);