net: connection: Log an error when running out of contexts

Running out of connection contexts is most likely due to app
misconfiguration, therefore it's useful to get an explicit information
that context allocation failed.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
This commit is contained in:
Robert Lubos 2024-04-08 11:53:08 +02:00 committed by Carles Cufí
parent 9f0cd47c78
commit 837d09ed9e
1 changed files with 2 additions and 0 deletions

View File

@ -352,6 +352,8 @@ int net_conn_register(uint16_t proto, uint8_t family,
conn = conn_get_unused(); conn = conn_get_unused();
if (!conn) { if (!conn) {
NET_ERR("Not enough connection contexts. "
"Consider increasing CONFIG_NET_MAX_CONN.");
return -ENOENT; return -ENOENT;
} }