From aebe37a4619864fa0d1a083f3e5171bb3b6e116f Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Tue, 26 Nov 2002 03:16:31 +0000 Subject: [PATCH] ensure that zone id is set to zero. only look for BSD internal scope if platform supports scope_id. reviewer: marka developer: jinmei --- lib/isc/unix/interfaceiter.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/isc/unix/interfaceiter.c b/lib/isc/unix/interfaceiter.c index c246e6a0ba..498362effe 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);