]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
Merge bk://www.ntp.org/home/bk/ntp-dev
authorFrank Kardel <kardel@ntp.org>
Sun, 19 Mar 2006 08:57:16 +0000 (08:57 +0000)
committerFrank Kardel <kardel@ntp.org>
Sun, 19 Mar 2006 08:57:16 +0000 (08:57 +0000)
into  pogo.udel.edu:/pogo/users/kardel/dynamic-if/ntp-dev

bk: 441d1cecoMZ-oSn8AnhxerhiYAx2EQ

1  2 
include/ntpd.h
ntpd/ntp_config.c
ntpd/ntp_crypto.c
ntpd/ntp_io.c
ntpd/ntp_restrict.c
ntpd/ntp_timer.c
ntpd/ntp_util.c
ntpd/refclock_parse.c
ntpdc/ntpdc.c

diff --cc include/ntpd.h
Simple merge
Simple merge
Simple merge
diff --cc ntpd/ntp_io.c
index 0b24a6aea22529daf207e10c2d756157e82382db,9614ddeb56e846a1c20987a3a5f4b9a46c7a0b8f..2290fd0f18dc45794d1cfe8ba9b0d42091ef5729
@@@ -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
index fb6bc60386c18fc7713f99ab2de7d82c7503483f,25047f91645854cf12b9a68cd5abb52c25b7e2cc..eb454e20d923d696067d70601a2c398febdf2268
@@@ -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--;
index 83c416ead1963972b3835e7dc854adf7c9ce1ff3,6c96d24b46c57bbe8e575776c2f66fa8afc19d3b..bffec92156bdf5c0c3107ea0ad988821d0b039e7
@@@ -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;
        }
  }
  
diff --cc ntpd/ntp_util.c
Simple merge
Simple merge
diff --cc ntpdc/ntpdc.c
Simple merge