From: Harlan Stenn Date: Wed, 17 May 2000 02:26:36 +0000 (-0000) Subject: Many files: X-Git-Tag: NTP_4_0_99_J~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=49dc07852225a97da4a5b0f39a6a025fc2b227de;p=thirdparty%2Fntp.git Many files: * ntpd/ntp_util.c (stats_config): * ntpd/ntp_loopfilter.c (loop_config): * libntp/systime.c (adj_systime): * include/ntp_proto.h (NTP_MAXFREQ): Renamed MAX_FREQ to NTP_MAXFREQ * ntpd/ntpd.c (ntpdmain): * ntpd/ntp_proto.c (receive): (poll_update): * ntpd/ntp_intres.c (addentry): * ntpd/ntp_config.c (getconfig): Lint cleanup From: Marc Brett bk: 3922035c-CQcHpmcMXiYjQkRmCCceQ --- diff --git a/ChangeLog b/ChangeLog index a88e215a2..6ac8f519d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,19 @@ 2000-05-16 Harlan Stenn + * ntpd/ntp_util.c (stats_config): + * ntpd/ntp_loopfilter.c (loop_config): + * libntp/systime.c (adj_systime): + * include/ntp_proto.h (NTP_MAXFREQ): + Renamed MAX_FREQ to NTP_MAXFREQ + + * ntpd/ntpd.c (ntpdmain): + * ntpd/ntp_proto.c (receive): + (poll_update): + * ntpd/ntp_intres.c (addentry): + * ntpd/ntp_config.c (getconfig): + Lint cleanup + From: Marc Brett + * include/ntp_stdlib.h: * libntp/systime.c (adj_systime): * ntpd/ntp_loopfilter.c (loop_config): diff --git a/include/ntp_proto.h b/include/ntp_proto.h index 0ea7a9b43..e6e785533 100644 --- a/include/ntp_proto.h +++ b/include/ntp_proto.h @@ -5,6 +5,6 @@ #include #endif -#define MAX_FREQ 500e-6 +#define NTP_MAXFREQ 500e-6 #endif /* __ntp_proto_h */ diff --git a/libntp/systime.c b/libntp/systime.c index f9f9f8806..edaac1e33 100644 --- a/libntp/systime.c +++ b/libntp/systime.c @@ -138,8 +138,8 @@ adj_systime( } } else #endif - if (dtemp > MAX_FREQ) - dtemp = MAX_FREQ; + if (dtemp > NTP_MAXFREQ) + dtemp = NTP_MAXFREQ; dtemp = dtemp * 1e6 + .5; diff --git a/ntpd/ntp_config.c b/ntpd/ntp_config.c index 263629819..9d2bba364 100644 --- a/ntpd/ntp_config.c +++ b/ntpd/ntp_config.c @@ -708,8 +708,8 @@ getconfig( int ttl; unsigned long ul; keyid_t peerkey; - char *peerkeystr; - keyid_t lpeerkey; + u_char *peerkeystr; + keyid_t lpeerkey = 0; int peerflags; int hmode; struct sockaddr_in peeraddr; diff --git a/ntpd/ntp_intres.c b/ntpd/ntp_intres.c index 85676b1a7..ad333fa5e 100644 --- a/ntpd/ntp_intres.c +++ b/ntpd/ntp_intres.c @@ -418,7 +418,7 @@ addentry( ce->ce_flags = (u_char)flags; ce->ce_ttl = (u_char)ttl; ce->ce_keyid = keyid; - strncpy(ce->ce_keystr, keystr, MAXFILENAME); + strncpy((char *)ce->ce_keystr, keystr, MAXFILENAME); ce->ce_next = NULL; if (confentries == NULL) { diff --git a/ntpd/ntp_loopfilter.c b/ntpd/ntp_loopfilter.c index d92158745..f2c8d625d 100644 --- a/ntpd/ntp_loopfilter.c +++ b/ntpd/ntp_loopfilter.c @@ -537,10 +537,10 @@ local_clock( */ etemp = clock_frequency + flladj + plladj; drift_comp += etemp; - if (drift_comp > MAX_FREQ) - drift_comp = MAX_FREQ; - else if (drift_comp <= -MAX_FREQ) - drift_comp = -MAX_FREQ; + if (drift_comp > NTP_MAXFREQ) + drift_comp = NTP_MAXFREQ; + else if (drift_comp <= -NTP_MAXFREQ) + drift_comp = -NTP_MAXFREQ; dtemp = SQUARE(clock_stability); etemp = SQUARE(etemp) - dtemp; clock_stability = SQRT(dtemp + etemp / CLOCK_AVG); @@ -743,10 +743,10 @@ loop_config( */ rstclock(S_FSET); drift_comp = freq; - if (drift_comp > MAX_FREQ) - drift_comp = MAX_FREQ; - if (drift_comp < -MAX_FREQ) - drift_comp = -MAX_FREQ; + if (drift_comp > NTP_MAXFREQ) + drift_comp = NTP_MAXFREQ; + if (drift_comp < -NTP_MAXFREQ) + drift_comp = -NTP_MAXFREQ; #ifdef KERNEL_PLL /* * If the phase-lock code is implemented in the kernel, diff --git a/ntpd/ntp_proto.c b/ntpd/ntp_proto.c index c44a10805..26c0db46f 100644 --- a/ntpd/ntp_proto.c +++ b/ntpd/ntp_proto.c @@ -230,7 +230,10 @@ receive( int authlen; /* offset of MAC field */ int is_authentic; /* cryptosum ok */ int is_error; /* parse error */ - keyid_t pkeyid, skeyid, tkeyid; /* cryptographic keys */ + keyid_t skeyid; /* cryptographic keys */ +#ifdef AUTOKEY + keyid_t pkeyid, tkeyid; /* cryptographic keys */ +#endif /* AUTOKEY */ struct peer *peer2; int retcode = AM_NOMATCH; @@ -323,7 +326,10 @@ receive( * an extension field is present. If 2 or 4, the packet is a * runt and thus discarded. */ - pkeyid = skeyid = tkeyid = 0; + skeyid = 0; +#ifdef AUTOKEY + pkeyid = tkeyid = 0; +#endif /* AUTOKEY */ authlen = LEN_PKT_NOMAC; while ((has_mac = rbufp->recv_length - authlen) > 0) { int temp; @@ -1040,7 +1046,9 @@ poll_update( int hpoll ) { +#ifdef AUTOKEY long oldpoll; +#endif /* AUTOKEY */ /* * The wiggle-the-poll-interval dance. Broadcasters dance only @@ -1049,7 +1057,11 @@ poll_update( * clock. Broadcast clients are usually lead by their broadcast * partner, but faster in the initial mating dance. */ + +#ifdef AUTOKEY oldpoll = peer->kpoll; +#endif /* AUTOKEY */ + if (peer->hmode == MODE_BROADCAST) { peer->hpoll = peer->minpoll; } else if (peer->flags & FLAG_SYSPEER) { diff --git a/ntpd/ntp_util.c b/ntpd/ntp_util.c index e0ed4c60f..b648ad226 100644 --- a/ntpd/ntp_util.c +++ b/ntpd/ntp_util.c @@ -352,7 +352,7 @@ stats_config( } (void) fclose(fp); if ( !finite(old_drift) - || (fabs(old_drift) > (MAX_FREQ * 1e6))) { + || (fabs(old_drift) > (NTP_MAXFREQ * 1e6))) { msyslog(LOG_ERR, "invalid frequency (%f) in %s", old_drift, stats_drift_file); exit(1); diff --git a/ntpd/ntpd.c b/ntpd/ntpd.c index 4843c6d0e..ada545366 100644 --- a/ntpd/ntpd.c +++ b/ntpd/ntpd.c @@ -339,8 +339,8 @@ ntpdmain( { l_fp now; char *cp; - u_int n; #ifdef AUTOKEY + u_int n; char hostname[MAXFILENAME]; #endif /* AUTOKEY */ struct recvbuf *rbuflist;