From: Danny Mayer Date: Sat, 19 Apr 2003 13:10:42 +0000 (-0400) Subject: Fix casting issues. X-Git-Tag: NTP_4_1_80_RC1~44^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=183fc660870f8a33f31aeddec81e539d180937e1;p=thirdparty%2Fntp.git Fix casting issues. bk: 3ea14ad2RsV6DOovZmwuKzi8ivqehA --- diff --git a/ntpd/ntp_proto.c b/ntpd/ntp_proto.c index 56785af97..ce7ba319c 100644 --- a/ntpd/ntp_proto.c +++ b/ntpd/ntp_proto.c @@ -1709,7 +1709,7 @@ clock_filter( * consider the update a popcorn spike and ignore it. */ if (m > 1 && etemp > CLOCK_SGATE * dtemp && - peer->filter_epoch[k] - peer->epoch < (1 << (sys_poll + + (long)(peer->filter_epoch[k] - peer->epoch) < (1 << (sys_poll + 1))) { #ifdef DEBUG if (debug) @@ -2303,7 +2303,7 @@ peer_xmit( { struct pkt xpkt; /* transmit packet */ int sendlen, authlen; - keyid_t xkeyid; /* transmit key ID */ + keyid_t xkeyid = 0; /* transmit key ID */ l_fp xmt_tx; /* @@ -2778,8 +2778,8 @@ fast_xmit( */ cookie = session_key(&rbufp->recv_srcadr, &rbufp->dstadr->sin, 0, sys_private, 0); - if (rbufp->recv_length >= sendlen + MAX_MAC_LEN + 2 * - sizeof(u_int32)) { + if (rbufp->recv_length >= (int)(sendlen + MAX_MAC_LEN + 2 * + sizeof(u_int32))) { session_key(&rbufp->dstadr->sin, &rbufp->recv_srcadr, xkeyid, 0, 2); temp32 = CRYPTO_RESP; diff --git a/ntpd/ntp_request.c b/ntpd/ntp_request.c index 409b78c7d..f825b5ff0 100644 --- a/ntpd/ntp_request.c +++ b/ntpd/ntp_request.c @@ -531,10 +531,10 @@ process_private( l_fp ftmp; double dtemp; - if (rbufp->recv_length < (REQ_LEN_HDR + + if (rbufp->recv_length < (int)((REQ_LEN_HDR + (INFO_ITEMSIZE(inpkt->mbz_itemsize) * INFO_NITEMS(inpkt->err_nitems)) - + sizeof(struct req_pkt_tail))) { + + sizeof(struct req_pkt_tail)))) { req_ack(srcadr, inter, inpkt, INFO_ERR_FMT); } tailinpkt = (struct req_pkt_tail *)((char *)&rbufp->recv_pkt + @@ -887,8 +887,8 @@ peer_info ( ip->filtdelay[i] = HTONS_FP(DTOFP(pp->filter_delay[j])); DTOLFP(pp->filter_offset[j], <mp); HTONL_FP(<mp, &ip->filtoffset[i]); - ip->order[i] = (pp->filter_nextpt+NTP_SHIFT-1) - - pp->filter_order[i]; + ip->order[i] = (u_char)((pp->filter_nextpt+NTP_SHIFT-1) + - pp->filter_order[i]); if (ip->order[i] >= NTP_SHIFT) ip->order[i] -= NTP_SHIFT; } diff --git a/ntpd/ntp_restrict.c b/ntpd/ntp_restrict.c index 94c185753..ede42257d 100644 --- a/ntpd/ntp_restrict.c +++ b/ntpd/ntp_restrict.c @@ -46,7 +46,7 @@ int idx; \ for (idx = 0; idx < 16; idx++) { \ (dst)->s6_addr[idx] = \ - (src)->s6_addr[idx] & (msk)->s6_addr[idx]; \ + (u_char) ((src)->s6_addr[idx] & (msk)->s6_addr[idx]); \ } \ } while (0) @@ -307,6 +307,8 @@ hack_restrict( register struct restrictlist6 *rl6 = NULL; register struct restrictlist6 *rlprev6 = NULL; int i, addr_cmp, mask_cmp; + memset(&addr6, 0, sizeof(struct in6_addr)); + memset(&mask6, 0, sizeof(struct in6_addr)); if (resaddr->ss_family == AF_INET) { /*