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: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
This commit is contained in:
parent
ed0dcca2fb
commit
c6a1af5c17
1 changed files with 2 additions and 2 deletions
|
@ -345,7 +345,7 @@ static enum net_verdict bridge_iface_process(struct net_if *iface,
|
||||||
/* Drop all link-local packets for now. */
|
/* Drop all link-local packets for now. */
|
||||||
if (is_link_local_addr((struct net_eth_addr *)net_pkt_lladdr_dst(pkt))) {
|
if (is_link_local_addr((struct net_eth_addr *)net_pkt_lladdr_dst(pkt))) {
|
||||||
NET_DBG("DROP: lladdr");
|
NET_DBG("DROP: lladdr");
|
||||||
return NET_DROP;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
lock_bridge(ctx);
|
lock_bridge(ctx);
|
||||||
|
@ -397,11 +397,11 @@ static enum net_verdict bridge_iface_process(struct net_if *iface,
|
||||||
|
|
||||||
unlock_bridge(ctx);
|
unlock_bridge(ctx);
|
||||||
|
|
||||||
|
out:
|
||||||
/* The packet was cloned by the caller so remove it here. */
|
/* The packet was cloned by the caller so remove it here. */
|
||||||
net_pkt_unref(pkt);
|
net_pkt_unref(pkt);
|
||||||
|
|
||||||
return NET_OK;
|
return NET_OK;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int bridge_iface_send(struct net_if *iface, struct net_pkt *pkt)
|
int bridge_iface_send(struct net_if *iface, struct net_pkt *pkt)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue