Skip to content
Commit 9f12dbba authored by Marcin Niestroj's avatar Marcin Niestroj Committed by Jukka Rissanen
Browse files

net: sockets: improve DGRAM recvfrom() on NET_OFFLOAD iface



When recvfrom() was called with src_addr != NULL, then source address
was fetched from beginning of net_pkt. This works with native IP stack
obviously. However with offloaded IP stack there is no IP header, so
trying to parse missing IP header results in undefined behavior.

Check if network interface has offloaded IP stack. If positive, then
figure out if there is assigned remote address to network context on
which packet was received. Return this remote address, which SHOULD be
the source address of received packet. Otherwise, return an error.

Signed-off-by: default avatarMarcin Niestroj <m.niestroj@emb.dev>
parent 64790738
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment