/* alloc enough for us, plus a few globs for other threads */
alloc = transfer + (3 * rx_TSFPQGlobSize) - rx_nFreePackets;
rxi_MorePacketsNoLock(MAX(alloc, rx_initSendWindow));
- transfer += rx_TSFPQGlobSize;
+ transfer = rx_TSFPQGlobSize;
}
RX_TS_FPQ_GTOL2(rx_ts_info, transfer);
* to hold maximal amounts of data */
apackets += (apackets / 4)
* ((rx_maxJumboRecvSize - RX_FIRSTBUFFERSIZE) / RX_CBUFFERSIZE);
- getme = apackets * sizeof(struct rx_packet);
- p = rx_mallocedP = (struct rx_packet *)osi_Alloc(getme);
-
+ do {
+ getme = apackets * sizeof(struct rx_packet);
+ p = rx_mallocedP = (struct rx_packet *)osi_Alloc(getme);
+ if (p == NULL) {
+ apackets -= apackets / 4;
+ osi_Assert(apackets > 0);
+ }
+ } while(p == NULL);
memset((char *)p, 0, getme);
for (e = p + apackets; p < e; p++) {