Skip to content

Commit 4e0386a

Browse files
JordanYateskartben
authored andcommitted
net: ip: net_if: warning message on send failure
Print a warning if sending a packet on the L2 interface fails. Currently this is completely silent unless `NET_DBG` is enabled and the `context` parameter is provided. Signed-off-by: Jordan Yates <jordan@embeint.com>
1 parent e71c12c commit 4e0386a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

subsys/net/ip/net_if.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,10 @@ static bool net_if_tx(struct net_if *iface, struct net_pkt *pkt)
261261
net_if_tx_lock(iface);
262262
status = net_if_l2(iface)->send(iface, pkt);
263263
net_if_tx_unlock(iface);
264+
if (status < 0) {
265+
NET_WARN("iface %d pkt %p send failure status %d",
266+
net_if_get_by_iface(iface), pkt, status);
267+
}
264268

265269
if (IS_ENABLED(CONFIG_NET_PKT_TXTIME_STATS) ||
266270
IS_ENABLED(CONFIG_TRACING_NET_CORE)) {

0 commit comments

Comments
 (0)