From: Danny Mayer Date: Sat, 26 Apr 2003 04:07:53 +0000 (-0400) Subject: Fixes to deal with bug #37 and fix for non-IPv6 stack machines to deal with IPv6... X-Git-Tag: NTP_4_1_80_RC1~35^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4f3249c84e7701b5a62024700ad45e81aa8f422d;p=thirdparty%2Fntp.git Fixes to deal with bug #37 and fix for non-IPv6 stack machines to deal with IPv6 addresses. bk: 3eaa0619c0R3ziKespZI6OBHnoMsbA --- diff --git a/libntp/socktoa.c b/libntp/socktoa.c index 39d32c4a8..34de7848a 100644 --- a/libntp/socktoa.c +++ b/libntp/socktoa.c @@ -1,13 +1,8 @@ /* * socktoa - return a numeric host name from a sockaddr_storage structure */ -#ifdef SYS_WINNT -/* Skip asynch rpc inclusion */ -#ifndef __RPCASYNC_H__ -#define __RPCASYNC_H__ -#endif -#include -#endif + +#include #include #include @@ -16,7 +11,7 @@ #include -#ifndef HAVE_IPV6 +#ifdef ISC_PLATFORM_NEEDNTOP #include #endif diff --git a/ntpd/ntp_request.c b/ntpd/ntp_request.c index f825b5ff0..73f9e372a 100644 --- a/ntpd/ntp_request.c +++ b/ntpd/ntp_request.c @@ -728,6 +728,7 @@ peer_list_sum( ips->srcadr = GET_INADDR(pp->srcadr); if (client_v6_capable) ips->v6_flag = 0; +/* XXX This code is buggy. Replaced with a straightforward assignment ips->dstadr = (pp->processed) ? pp->cast_flags == MDF_BCAST ? GET_INADDR(pp->dstadr->bcast): @@ -736,6 +737,8 @@ peer_list_sum( GET_INADDR(pp->dstadr->sin): GET_INADDR(pp->dstadr->bcast): 1 : 5; +*/ + ips->dstadr = GET_INADDR(pp->dstadr->sin); skip = 0; } if (!skip){ @@ -828,6 +831,7 @@ peer_info ( ip->srcadr6 = GET_INADDR6(pp->srcadr); ip->v6_flag = 1; } else { +/* XXX This code is buggy. Replaced with a straightforward assignment ip->dstadr = (pp->processed) ? pp->cast_flags == MDF_BCAST ? GET_INADDR(pp->dstadr->bcast): @@ -836,6 +840,8 @@ peer_info ( GET_INADDR(pp->dstadr->sin): GET_INADDR(pp->dstadr->bcast): 2 : 6; +*/ + ip->dstadr = GET_INADDR(pp->dstadr->sin); ip->srcadr = GET_INADDR(pp->srcadr); if (client_v6_capable) ip->v6_flag = 0; diff --git a/ports/winnt/include/config.h b/ports/winnt/include/config.h index 209fcaa85..7566006b0 100644 --- a/ports/winnt/include/config.h +++ b/ports/winnt/include/config.h @@ -91,6 +91,7 @@ int NT_set_process_priority(void); /* Define this function */ # define TIME_WITH_SYS_TIME # define HAVE_IO_COMPLETION_PORT # define HAVE_SOCKADDR_IN6 +# define ISC_PLATFORM_NEEDNTOP # define NEED_S_CHAR_TYPEDEF