Commit b57d4cc1 authored by Jukka Rissanen's avatar Jukka Rissanen Committed by Benjamin Cabé
Browse files

net: core: Free packet properly if TTL/hop limit is 0

We drop the packet if TTL or hop limit is 0, but we should
also unref the packet in this case because we return 0 to
the caller which is not then able to free the packet because
it thinks that the packet was sent properly.

Signed-off-by: default avatarJukka Rissanen <jukka.rissanen@nordicsemi.no>
(cherry picked from commit 2f1a134f)
parent 537361e7
Loading
Loading
Loading
Loading
+1 −0
Changes for subsys/net/ip/net_core.c: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -392,6 +392,7 @@ int net_send_data(struct net_pkt *pkt)
		 * we just silently drop the packet by returning 0.
		 */
		if (status == -ENOMSG) {
			net_pkt_unref(pkt);
			ret = 0;
			goto err;
		}