Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions subsys/net/ip/net_context.c
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,13 @@ int net_context_get(sa_family_t family, enum net_sock_type type, uint16_t proto,
k_sem_give(&contexts_lock);

if (ret < 0) {
if (ret == -EADDRINUSE &&
!net_if_is_ip_offloaded(net_if_get_default()) &&
proto == IPPROTO_TCP) {
/* Free the TCP context that we allocated earlier */
net_tcp_put(&contexts[i]);
}

return ret;
}

Expand Down
Loading