]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
ensure that zone id is set to zero.
authorMark Andrews <marka@isc.org>
Tue, 26 Nov 2002 03:16:31 +0000 (03:16 +0000)
committerMark Andrews <marka@isc.org>
Tue, 26 Nov 2002 03:16:31 +0000 (03:16 +0000)
only look for BSD internal scope if platform supports scope_id.
reviewer: marka
developer: jinmei

lib/isc/unix/interfaceiter.c

index c246e6a0babb02373429c891aa6f11bf9c482dcd..498362effe31d5831686c011448c46025e6b1907 100644 (file)
@@ -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 <config.h>
 
@@ -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);