In my review of #1055 (comment) , I expressed my surprised that we didn't have a func like net_pkt_get_src_addr() before. And indeed, we had something like that as net_context.c:create_sockaddr(), except that latter was confusingly named and worked only for TCP (kinda, the only thing it needs from TCP are port numbers, and those match UDP header).
Let's now think how to get rid of duplication.