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: Marcin Niestroj <m.niestroj@emb.dev> |
||
|---|---|---|
| .. | ||
| CMakeLists.txt | ||
| getaddrinfo.c | ||
| getnameinfo.c | ||
| Kconfig | ||
| socket_offload.c | ||
| socketpair.c | ||
| sockets_can.c | ||
| sockets_internal.h | ||
| sockets_misc.c | ||
| sockets_net_mgmt.c | ||
| sockets_packet.c | ||
| sockets_select.c | ||
| sockets_tls.c | ||
| sockets.c | ||