Skip to content

Commit

Permalink
net: context: log on net_pkt alloc fail
Browse files Browse the repository at this point in the history
Log an error when allocating a network packet for transmission fails.
This is a problem which can be solved by increasing
`CONFIG_NET_PKT_TX_COUNT`, but is currently hard to diagnose.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
  • Loading branch information
Jordan Yates authored and carlescufi committed Apr 8, 2022
1 parent 5d929ba commit c910e4d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions subsys/net/ip/net_context.c
Original file line number Diff line number Diff line change
Expand Up @@ -1638,6 +1638,7 @@ static int context_sendto(struct net_context *context,

pkt = context_alloc_pkt(context, len, PKT_WAIT_TIME);
if (!pkt) {
NET_ERR("Failed to allocate net_pkt");
return -ENOBUFS;
}

Expand Down

0 comments on commit c910e4d

Please sign in to comment.