]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
recvbuf typo fix and diagnostics
authorHarlan Stenn <stenn@ntp.org>
Sun, 11 Dec 2005 22:04:21 +0000 (17:04 -0500)
committerHarlan Stenn <stenn@ntp.org>
Sun, 11 Dec 2005 22:04:21 +0000 (17:04 -0500)
bk: 439ca265Wk3uyKl0-qeKdfnT8gxkGw

libntp/recvbuff.c
ntpd/ntpd.c

index 8720a8a2b6b565851673602a340d71641f9978d1..25c4bfb677d95b52fc46bbe4c9fe3e96d4e9cae4 100644 (file)
@@ -17,8 +17,8 @@
  */
 static u_long volatile full_recvbufs;  /* number of recvbufs on fulllist */
 static u_long volatile free_recvbufs;  /* number of recvbufs on freelist */
-static u_long volatile total_recvbufs; /* total recvbufs currently in use */
-static u_long volatile lowater_adds;   /* number of times we have added memory */
+static u_long volatile total_recvbufs; /* number of recvbufs available */
+static u_long volatile lowater_adds;   /* number of times we have added recvbufs */
 
 
 static ISC_LIST(recvbuf_t)     full_list;      /* Currently used recv buffers */
@@ -178,6 +178,14 @@ recvbuf_t *
 get_full_recv_buffer(void)
 {
        recvbuf_t *rbuf;
+
+#ifdef DEBUG
+       if (debug)
+           printf("get_full_recv_buffer() called and full_recvbufs is %d\n", full_recvbufs);
+       else
+#endif
+       if (0 == full_recvbufs)
+           msyslog(LOG_ERR, "get_full_recv_buffer() called but full_recvbufs is 0!");
        LOCK();
        rbuf = ISC_LIST_HEAD(full_list);
        if (rbuf != NULL)
index bc0d5b2746ae8f85f3f24127a6e6a32f401db1de..a922af1e6c279b6ceabd3273c5ad58e75ada9691 100644 (file)
@@ -875,7 +875,7 @@ getgroup:
                        alarm_flag = 0;
                }
 
-               if (!was_alarmed && tot_full_recvbufs > 0)
+               if (!was_alarmed && tot_full_recvbufs == 0)
                {
                        /*
                         * Nothing to do.  Wait for something.