]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
Fix casting issues.
authorDanny Mayer <mayer@ntp.org>
Sat, 19 Apr 2003 13:10:42 +0000 (09:10 -0400)
committerDanny Mayer <mayer@ntp.org>
Sat, 19 Apr 2003 13:10:42 +0000 (09:10 -0400)
bk: 3ea14ad2RsV6DOovZmwuKzi8ivqehA

ntpd/ntp_proto.c
ntpd/ntp_request.c
ntpd/ntp_restrict.c

index 56785af975a50135be3703e5afe83f737eacdd0f..ce7ba319c12738ae8028dc28adc1203b83fea951 100644 (file)
@@ -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;
index 409b78c7d61cb89b031cd017db8c8c82ac02f4e0..f825b5ff06f9d39e107a428dec8b7d077ff6cf07 100644 (file)
@@ -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], &ltmp);
                        HTONL_FP(&ltmp, &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;
                }
index 94c1857534d068f12091528496c5dc0890803661..ede42257d2367caa5124f7e33eada79e642dd54b 100644 (file)
@@ -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) {
                /*