From: Danny Mayer Date: Fri, 23 Apr 2004 23:23:39 +0000 (-0400) Subject: Modification to correct for type errors X-Git-Tag: NTP_4_2_3~170^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f4c6359c94c27ae626b049b1373f7b5f7b90d020;p=thirdparty%2Fntp.git Modification to correct for type errors bk: 4089a57b6qX3i3OlEV2IYJAScyDfVg --- diff --git a/include/ntp_rfc2553.h b/include/ntp_rfc2553.h index fe629ed07..ede8054e9 100644 --- a/include/ntp_rfc2553.h +++ b/include/ntp_rfc2553.h @@ -90,8 +90,8 @@ #define _SS_MAXSIZE 128 #define _SS_ALIGNSIZE (sizeof(ntp_uint64_t)) #ifdef HAVE_SA_LEN_IN_STRUCT_SOCKADDR -#define _SS_PAD1SIZE (_SS_ALIGNSIZE - sizeof(u_char) - sizeof(u_int8_t)) -#define _SS_PAD2SIZE (_SS_MAXSIZE - sizeof(u_char) - sizeof(u_int8_t) - \ +#define _SS_PAD1SIZE (_SS_ALIGNSIZE - sizeof(u_char) - sizeof(ntp_u_int8_t)) +#define _SS_PAD2SIZE (_SS_MAXSIZE - sizeof(u_char) - sizeof(ntp_u_int8_t) - \ _SS_PAD1SIZE - _SS_ALIGNSIZE) #else #define _SS_PAD1SIZE (_SS_ALIGNSIZE - sizeof(short)) @@ -108,8 +108,8 @@ #ifndef HAVE_STRUCT_SOCKADDR_STORAGE struct sockaddr_storage { #ifdef HAVE_SA_LEN_IN_STRUCT_SOCKADDR - u_int8_t ss_len; /* address length */ - u_int8_t ss_family; /* address family */ + ntp_u_int8_t ss_len; /* address length */ + ntp_u_int8_t ss_family; /* address family */ #else short ss_family; /* address family */ #endif @@ -154,9 +154,9 @@ struct sockaddr_storage { struct in6_addr { union { - u_int8_t __u6_addr8[16]; - u_int16_t __u6_addr16[8]; - u_int32_t __u6_addr32[4]; + ntp_u_int8_t __u6_addr8[16]; + ntp_u_int16_t __u6_addr16[8]; + ntp_u_int32_t __u6_addr32[4]; } __u6_addr; /* 128-bit IP6 address */ }; @@ -180,15 +180,15 @@ extern const struct in6_addr in6addr_any; #ifndef HAVE_SOCKADDR_IN6 struct sockaddr_in6 { #ifdef HAVE_SA_LEN_IN_STRUCT_SOCKADDR - u_int8_t sin6_len; /* length of this struct(sa_family_t)*/ - u_int8_t sin6_family; /* AF_INET6 (sa_family_t) */ + ntp_u_int8_t sin6_len; /* length of this struct(sa_family_t)*/ + ntp_u_int8_t sin6_family; /* AF_INET6 (sa_family_t) */ #else short sin6_family; /* AF_INET6 (sa_family_t) */ #endif - u_int16_t sin6_port; /* Transport layer port # (in_port_t)*/ - u_int32_t sin6_flowinfo; /* IP6 flow information */ + ntp_u_int16_t sin6_port; /* Transport layer port # (in_port_t)*/ + ntp_u_int32_t sin6_flowinfo; /* IP6 flow information */ struct in6_addr sin6_addr; /* IP6 address */ - u_int32_t sin6_scope_id; /* scope zone index */ + ntp_u_int32_t sin6_scope_id; /* scope zone index */ }; #endif @@ -197,10 +197,10 @@ struct sockaddr_in6 { */ #ifndef IN6_IS_ADDR_UNSPECIFIED #define IN6_IS_ADDR_UNSPECIFIED(a) \ - ((*(const u_int32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \ - (*(const u_int32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \ - (*(const u_int32_t *)(const void *)(&(a)->s6_addr[8]) == 0) && \ - (*(const u_int32_t *)(const void *)(&(a)->s6_addr[12]) == 0)) + ((*(const ntp_u_int32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \ + (*(const ntp_u_int32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \ + (*(const ntp_u_int32_t *)(const void *)(&(a)->s6_addr[8]) == 0) && \ + (*(const ntp_u_int32_t *)(const void *)(&(a)->s6_addr[12]) == 0)) #endif /* * Multicast diff --git a/include/ntp_types.h b/include/ntp_types.h index c9b4a7ec8..0b575c8c6 100644 --- a/include/ntp_types.h +++ b/include/ntp_types.h @@ -66,11 +66,9 @@ typedef unsigned int u_int; # include "Bletch: what's 32 bits on this machine?" #endif /* not sizeof(int) == 4 */ -#ifndef HAVE_TYPE_U_INT8_T -typedef u_char u_int8_t; -typedef u_short u_int16_t; -typedef u_int32 u_int32_t; -#endif /* HAVE_TYPE_U_INT8_T */ +typedef u_char ntp_u_int8_t; +typedef u_short ntp_u_int16_t; +typedef u_int32 ntp_u_int32_t; typedef struct ntp_uint64_t { u_int32 val[2]; } ntp_uint64_t; diff --git a/ntpd/ntp_io.c b/ntpd/ntp_io.c index 0b71e7907..c0f16b9ca 100644 --- a/ntpd/ntp_io.c +++ b/ntpd/ntp_io.c @@ -683,6 +683,10 @@ io_multicast_add( netsyslog(LOG_ERR, "multicast address %s not class D", inet_ntoa(iaddr)); +#ifdef DEBUG + if (debug >= 4) + printf("haddr value = %x\n", haddr); +#endif return; } for (i = nwilds; i < ninterfaces; i++) {