drivers: net: loopback: Allocate the loopback packet from proper poll

Use the new function to allocate a packet for the RX path from the RX
packet poll.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
This commit is contained in:
Robert Lubos 2022-03-23 15:07:43 +01:00 committed by Carles Cufí
commit e80a662ac7

View file

@ -97,7 +97,7 @@ static int loopback_send(const struct device *dev, struct net_pkt *pkt)
* must be dropped. This is very much needed for TCP packets where * must be dropped. This is very much needed for TCP packets where
* the packet is reference counted in various stages of sending. * the packet is reference counted in various stages of sending.
*/ */
cloned = net_pkt_clone(pkt, K_MSEC(100)); cloned = net_pkt_rx_clone(pkt, K_MSEC(100));
if (!cloned) { if (!cloned) {
res = -ENOMEM; res = -ENOMEM;
goto out; goto out;