zepif: Copy possibly chained output pbuf properly

Fixes bug #58554
This commit is contained in:
Erik Ekman 2020-07-01 22:05:28 +02:00
parent 2bf8fcd7c2
commit 8363c24e45

View File

@ -201,7 +201,7 @@ zepif_linkoutput(struct netif *netif, struct pbuf *p)
state->seqno++; state->seqno++;
zep->len = (u8_t)p->tot_len; zep->len = (u8_t)p->tot_len;
err = pbuf_take_at(q, p->payload, p->tot_len, sizeof(struct zep_hdr)); err = pbuf_copy_partial_pbuf(q, p, p->tot_len, sizeof(struct zep_hdr));
if (err == ERR_OK) { if (err == ERR_OK) {
#if ZEPIF_LOOPBACK #if ZEPIF_LOOPBACK
zepif_udp_recv(netif, state->pcb, pbuf_clone(PBUF_RAW, PBUF_RAM, q), NULL, 0); zepif_udp_recv(netif, state->pcb, pbuf_clone(PBUF_RAW, PBUF_RAM, q), NULL, 0);