Skip to content
Commit 4c541239 authored by Takuya Sasaki's avatar Takuya Sasaki Committed by Maureen Helm
Browse files

net: context: Fix the ICMP error on udp



When receiving a UDP packet, net_conn_input() searches for a
matching connection within `conn_used`.

However, when receiving UDP packets simultaneously from multiple
clients, we may encounter a situation where the connection that was
supposed to be bound cannot be found within `conn_used`, and raise
the ICMP error.

This is because, within recv_udp(), to avoid the failure of
bind_default(), we temporarily remove it from `conn_used` using
net_conn_unregister().

If the context already has a connection handler, it means it's
already registered. In that case, all we have to do is 1) update
the callback registered in the net_context and 2) update the
user_data and remote address and port using net_conn_update().

Fixes #70020

Signed-off-by: default avatarTakuya Sasaki <takuya.sasaki@spacecubics.com>
(cherry picked from commit 4f802e11)
parent bc1af7a9
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment