- follow-up: fix inverted sense in check, reset shortfall counter
bk: 5f152d34Tk2l0PxvOYBOc40-vSgCcQ
+---
+* [Bug 3666] avoid unlimited receive buffer allocation <perlinger@ntp.org>
+ - follow-up: fix inverted sense in check, reset shortfall counter
+
---
(4.2.8p15) 2020/06/23 Released by Harlan Stenn <stenn@ntp.org>
u_int i;
size_t abuf;
- if (limit_recvbufs <= total_recvbufs)
- return;
-
+ /*[bug 3666]: followup -- reset shortfalls in all cases */
abuf = nbufs + buffer_shortfall;
buffer_shortfall = 0;
+ if (limit_recvbufs <= total_recvbufs)
+ return;
+
if (abuf < nbufs || abuf > RECV_BATCH)
abuf = RECV_BATCH; /* clamp on overflow */
else
recvbuf_t *buffer = NULL;
LOCK_F();
- if (free_recvbufs > (urgent ? emerg_recvbufs : 0)) {
+ if (free_recvbufs > (urgent ? 0 : emerg_recvbufs)) {
UNLINK_HEAD_SLIST(buffer, free_recv_list, link);
}