From: Frank Kardel Date: Sun, 19 Mar 2006 08:57:16 +0000 (+0000) Subject: Merge bk://www.ntp.org/home/bk/ntp-dev X-Git-Tag: NTP_4_2_3P2~5^2~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2da47b8c904478bfd2aa8bf6beca91de63bf0bd5;p=thirdparty%2Fntp.git Merge bk://www.ntp.org/home/bk/ntp-dev into pogo.udel.edu:/pogo/users/kardel/dynamic-if/ntp-dev bk: 441d1cecoMZ-oSn8AnhxerhiYAx2EQ --- 2da47b8c904478bfd2aa8bf6beca91de63bf0bd5 diff --cc ntpd/ntp_io.c index 0b24a6aea,9614ddeb5..2290fd0f1 --- a/ntpd/ntp_io.c +++ b/ntpd/ntp_io.c @@@ -2514,13 -2120,19 +2514,16 @@@ read_network_packet(SOCKET fd, struct i { char buf[RX_BUFF_SIZE]; struct sockaddr_storage from; - fromlen = sizeof from; + if (rb != NULL) + freerecvbuf(rb); + + fromlen = sizeof(from); buflen = recvfrom(fd, buf, sizeof(buf), 0, (struct sockaddr*)&from, &fromlen); -#ifdef DEBUG - if (debug > 3) - printf("%s on (%lu) fd=%d from %s\n", + DPRINTF(4, ("%s on (%lu) fd=%d from %s\n", (itf->ignore_packets == ISC_TRUE) ? "ignore" : "drop", free_recvbuffs(), fd, - stoa(&from)); -#endif + stoa(&from))); if (itf->ignore_packets == ISC_TRUE) packets_ignored++; else diff --cc ntpd/ntp_restrict.c index fb6bc6038,25047f916..eb454e20d --- a/ntpd/ntp_restrict.c +++ b/ntpd/ntp_restrict.c @@@ -565,8 -568,12 +570,12 @@@ hack_restrict */ if (rl6 != 0 && !IN6_IS_ADDR_UNSPECIFIED(&rl6->addr6) - && !(rl6->mflags & RESM_INTERFACE)) { + && !(rl6->mflags & RESM_INTERFACE && op != RESTRICT_REMOVEIF)) { - rlprev6->next = rl6->next; + if (rlprev6) { + rlprev6->next = rl6->next; + } else { + restrictlist6 = rl6->next; + } restrictcount6--; if (rl6->flags & RES_LIMITED) { res_limited_refcnt6--; diff --cc ntpd/ntp_timer.c index 83c416ead,6c96d24b4..bffec9215 --- a/ntpd/ntp_timer.c +++ b/ntpd/ntp_timer.c @@@ -46,9 -44,8 +46,9 @@@ volatile int alarm_flag */ static u_long adjust_timer; /* second timer */ static u_long keys_timer; /* minute timer */ - static u_long hourly_timer; /* hour timer */ + static u_long stats_timer; /* stats timer */ static u_long huffpuff_timer; /* huff-n'-puff timer */ +static u_long interface_timer; /* interface update timer */ #ifdef OPENSSL static u_long revoke_timer; /* keys revoke timer */ u_char sys_revoke = KEY_REVOKE; /* keys revoke timeout (log2 s) */ @@@ -151,9 -148,8 +151,9 @@@ init_timer(void alarm_flag = 0; alarm_overflow = 0; adjust_timer = 1; - hourly_timer = HOUR; + stats_timer = 0; huffpuff_timer = 0; + interface_timer = 0; current_time = 0; timer_overflows = 0; timer_xmtcalls = 0; @@@ -339,24 -335,13 +339,25 @@@ timer(void } #endif /* OPENSSL */ + /* + * interface update timer + */ + if (interface_interval && interface_timer <= current_time) { + timer_interfacetimeout(current_time + interface_interval); +#ifdef DEBUG + if (debug) + printf("timer: interface update\n"); +#endif + interface_update(NULL, NULL); + } + /* - * Finally, call the hourly routine. + * Finally, periodically write stats. */ - if (hourly_timer <= current_time) { - hourly_timer += HOUR; - hourly_stats(); + if (stats_timer <= current_time) { + if (stats_timer != 0) + write_stats(); + stats_timer += stats_write_period; } }