]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
DEVEL15-fix-tsfpq-20090210
authorJeffrey Altman <jaltman@your-file-system.com>
Tue, 10 Feb 2009 22:42:50 +0000 (22:42 +0000)
committerDerrick Brashear <shadow@dementia.org>
Tue, 10 Feb 2009 22:42:50 +0000 (22:42 +0000)
LICENSE BSD

avoid transferring more than the number of packets in a queue

(cherry picked from commit 1050049411d1fc47441220c33e6353436fc586e7)

src/rx/rx_globals.h

index ee273016c03d8519a556b0ff6e28deb6616cf380..2ebeea3a6b4ebefc8759dec07f5d2ffbce23c55f 100644 (file)
@@ -297,7 +297,7 @@ EXT void rxi_FlushLocalPacketsTSFPQ(void); /* flush all thread-local packets to
     do { \
         int i; \
         struct rx_packet * p; \
-        int tsize = (rx_ts_info_p)->_FPQ.len - rx_TSFPQLocalMax + 3 *  rx_TSFPQGlobSize; \
+        int tsize = MIN((rx_ts_info_p)->_FPQ.len, (rx_ts_info_p)->_FPQ.len - rx_TSFPQLocalMax + 3 *  rx_TSFPQGlobSize); \
        if (tsize <= 0) break; \
         for (i=0,p=queue_Last(&((rx_ts_info_p)->_FPQ), rx_packet); \
              i < tsize; i++,p=queue_Prev(p, rx_packet)); \