Merge pull request #1934 from cesanta/myheart

Unbreak
This commit is contained in:
Sergio R. Caprile 2022-12-20 19:39:22 -03:00 committed by GitHub
commit 92aa538a84
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 0 deletions

View File

@ -866,6 +866,7 @@ void mip_init(struct mg_mgr *mgr, struct mip_if *ifp) {
size_t maxpktsize = 1540; size_t maxpktsize = 1540;
ifp->rx.ptr = (char *) calloc(1, maxpktsize), ifp->rx.len = maxpktsize; ifp->rx.ptr = (char *) calloc(1, maxpktsize), ifp->rx.len = maxpktsize;
ifp->tx.ptr = (char *) calloc(1, maxpktsize), ifp->tx.len = maxpktsize; ifp->tx.ptr = (char *) calloc(1, maxpktsize), ifp->tx.len = maxpktsize;
if (ifp->driver->rx == NULL && ifp->queue.len == 0) ifp->queue.len = 8192;
if (ifp->queue.len) ifp->queue.buf = (uint8_t *) calloc(1, ifp->queue.len); if (ifp->queue.len) ifp->queue.buf = (uint8_t *) calloc(1, ifp->queue.len);
ifp->timer_1000ms = mg_millis(); ifp->timer_1000ms = mg_millis();
arp_cache_init(ifp->arp_cache, MIP_ARP_ENTRIES, 12); arp_cache_init(ifp->arp_cache, MIP_ARP_ENTRIES, 12);

View File

@ -7334,6 +7334,7 @@ void mip_init(struct mg_mgr *mgr, struct mip_if *ifp) {
size_t maxpktsize = 1540; size_t maxpktsize = 1540;
ifp->rx.ptr = (char *) calloc(1, maxpktsize), ifp->rx.len = maxpktsize; ifp->rx.ptr = (char *) calloc(1, maxpktsize), ifp->rx.len = maxpktsize;
ifp->tx.ptr = (char *) calloc(1, maxpktsize), ifp->tx.len = maxpktsize; ifp->tx.ptr = (char *) calloc(1, maxpktsize), ifp->tx.len = maxpktsize;
if (ifp->driver->rx == NULL && ifp->queue.len == 0) ifp->queue.len = 8192;
if (ifp->queue.len) ifp->queue.buf = (uint8_t *) calloc(1, ifp->queue.len); if (ifp->queue.len) ifp->queue.buf = (uint8_t *) calloc(1, ifp->queue.len);
ifp->timer_1000ms = mg_millis(); ifp->timer_1000ms = mg_millis();
arp_cache_init(ifp->arp_cache, MIP_ARP_ENTRIES, 12); arp_cache_init(ifp->arp_cache, MIP_ARP_ENTRIES, 12);