From 64ab7f2a6e84f0289a8ed0588e98f5d75a01fd94 Mon Sep 17 00:00:00 2001
From: Erik Ekman <erik@kryo.se>
Date: Wed, 1 Jul 2020 22:05:28 +0200
Subject: [PATCH] zepif: Copy possibly chained output pbuf properly

Fixes bug #58554
---
 src/netif/zepif.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/netif/zepif.c b/src/netif/zepif.c
index b4033030b..de43b99b5 100644
--- a/src/netif/zepif.c
+++ b/src/netif/zepif.c
@@ -201,7 +201,7 @@ zepif_linkoutput(struct netif *netif, struct pbuf *p)
   state->seqno++;
   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 ZEPIF_LOOPBACK
     zepif_udp_recv(netif, state->pcb, pbuf_clone(PBUF_RAW, PBUF_RAM, q), NULL, 0);