Skip to content

Commit

Permalink
net: lldp: Send replies with timeout K_NO_WAIT
Browse files Browse the repository at this point in the history
This ensures system stays operation in lldp-flood situation.

Signed-off-by: Cla Mattia Galliard <[email protected]>
  • Loading branch information
clamattia committed Feb 26, 2025
1 parent c9a4013 commit ff6f577
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion subsys/net/l2/ethernet/lldp/lldp.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,10 @@ static int lldp_send(struct ethernet_lldp *lldp)
net_pkt_lladdr_dst(pkt)->addr = (uint8_t *)lldp_multicast_eth_addr.addr;
net_pkt_lladdr_dst(pkt)->len = sizeof(struct net_eth_addr);

if (net_if_send_data(lldp->iface, pkt) == NET_DROP) {
/* send without timeout, so we do not risk being blocked by tx when
* being flooded
*/
if (net_if_try_send_data(lldp->iface, pkt, K_NO_WAIT) == NET_DROP) {
net_pkt_unref(pkt);
ret = -EIO;
}
Expand Down

0 comments on commit ff6f577

Please sign in to comment.