arch/nrf91/modem: fix returned source address
This commit is contained in:
parent
5ac8c71663
commit
ef252fc0fc
|
@ -891,12 +891,6 @@ static int nrf91_usrsock_recvfrom_handler(struct nrf91_usrsock_s *usrsock,
|
|||
buflen = sizeof(usrsock->out) - sizeof(*ack) - inaddrlen;
|
||||
}
|
||||
|
||||
if (outaddrlen != 0)
|
||||
{
|
||||
tmp = (struct sockaddr *)(ack + 1);
|
||||
nx2nrf_sockaddr(tmp, (struct nrf_sockaddr *)&address);
|
||||
}
|
||||
|
||||
ret = nrf_recvfrom(req->usockid,
|
||||
(void *)(ack + 1) + inaddrlen,
|
||||
buflen,
|
||||
|
@ -909,6 +903,12 @@ static int nrf91_usrsock_recvfrom_handler(struct nrf91_usrsock_s *usrsock,
|
|||
ret = -errno;
|
||||
}
|
||||
|
||||
if (outaddrlen != 0)
|
||||
{
|
||||
tmp = (struct sockaddr *)(ack + 1);
|
||||
nrf2nx_sockaddr((struct nrf_sockaddr *)&address, tmp);
|
||||
}
|
||||
|
||||
recvlen = ret;
|
||||
|
||||
if (ret > 0 && outaddrlen < inaddrlen)
|
||||
|
|
Loading…
Reference in New Issue