Skip to content

Commit c6a1af5

Browse files
jukkarkartben
authored andcommitted
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 <[email protected]>
1 parent ed0dcca commit c6a1af5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

subsys/net/l2/ethernet/bridge.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ static enum net_verdict bridge_iface_process(struct net_if *iface,
345345
/* Drop all link-local packets for now. */
346346
if (is_link_local_addr((struct net_eth_addr *)net_pkt_lladdr_dst(pkt))) {
347347
NET_DBG("DROP: lladdr");
348-
return NET_DROP;
348+
goto out;
349349
}
350350

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

398398
unlock_bridge(ctx);
399399

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

403404
return NET_OK;
404-
405405
}
406406

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

0 commit comments

Comments
 (0)