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

net: ethernet: bridge: Drop the cloned packet in error



We need to drop the cloned packet that was fed to the bridge instead of
returning directly from the function. Without this change we have a
buffer leak.

Signed-off-by: default avatarJukka Rissanen <jukka.rissanen@nordicsemi.no>
parent ed0dcca2
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -345,7 +345,7 @@ static enum net_verdict bridge_iface_process(struct net_if *iface,
	/* Drop all link-local packets for now. */
	if (is_link_local_addr((struct net_eth_addr *)net_pkt_lladdr_dst(pkt))) {
		NET_DBG("DROP: lladdr");
		return NET_DROP;
		goto out;
	}

	lock_bridge(ctx);
@@ -397,11 +397,11 @@ static enum net_verdict bridge_iface_process(struct net_if *iface,

	unlock_bridge(ctx);

out:
	/* The packet was cloned by the caller so remove it here. */
	net_pkt_unref(pkt);

	return NET_OK;

}

int bridge_iface_send(struct net_if *iface, struct net_pkt *pkt)