From: Danny Mayer Date: Thu, 4 Dec 2003 04:33:46 +0000 (-0500) Subject: For KAME we need to fix the zeroing out of a couple of bytes. Fix to do it properly X-Git-Tag: NTP_4_2_3~193^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1e0dbe2dd1a0e505cd61780d2055fa91ff2f198a;p=thirdparty%2Fntp.git For KAME we need to fix the zeroing out of a couple of bytes. Fix to do it properly bk: 3fceb92anJkSegzMymB_5lpDYSFThQ --- diff --git a/libisc/interfaceiter.c b/libisc/interfaceiter.c index c69a01bab1..4d7724e921 100644 --- a/libisc/interfaceiter.c +++ b/libisc/interfaceiter.c @@ -71,6 +71,15 @@ get_addr(unsigned int family, isc_netaddr_t *dst, struct sockaddr *src) { memcpy(&dst->type.in6, &((struct sockaddr_in6 *) src)->sin6_addr, sizeof(struct in6_addr)); + + /* + * For KAME addresses we need to fix up the address + * for public consumption + */ +#ifdef __KAME__ + dst->type.in6.s6_addr[2] = 0; + dst->type.in6.s6_addr[3] = 0; +#endif break; default: INSIST(0); @@ -98,8 +107,6 @@ get_scopeid(unsigned int family, struct sockaddr *src) { u_int8_t *p; p = &((struct sockaddr_in6 *)src)->sin6_addr.s6_addr[0]; scopeid = ((u_int16_t)p[2] << 8) | p[3]; - &((struct sockaddr_in6 *)src)->sin6_addr.s6_addr[2] = 0; - &((struct sockaddr_in6 *)src)->sin6_addr.s6_addr[3] = 0; } else scopeid = 0; #else