modem: hl7800: set RX socket remote address

Set the remote address of received sockets.
This is necessary for services that rely on the remote address.
DNS relies on the remote address to be set properly.

Signed-off-by: Ryan Erickson <ryan.erickson@ezurio.com>
This commit is contained in:
Ryan Erickson 2024-07-08 13:44:39 -05:00 committed by Anas Nashif
parent 33a9e4b088
commit 7bef3fd8af

View file

@ -1588,6 +1588,8 @@ static int pkt_setup_ip_data(struct net_pkt *pkt, struct hl7800_socket *sock)
&((struct sockaddr_in6 *)&sock->src)->sin6_addr)) {
return -1;
}
net_pkt_set_remote_address(pkt, &sock->dst, sizeof(struct sockaddr_in6));
pkt->remote.sa_family = AF_INET6;
src_port = ntohs(net_sin6(&sock->src)->sin6_port);
dst_port = ntohs(net_sin6(&sock->dst)->sin6_port);
@ -1601,6 +1603,8 @@ static int pkt_setup_ip_data(struct net_pkt *pkt, struct hl7800_socket *sock)
&((struct sockaddr_in *)&sock->src)->sin_addr)) {
return -1;
}
net_pkt_set_remote_address(pkt, &sock->dst, sizeof(struct sockaddr_in));
pkt->remote.sa_family = AF_INET;
src_port = ntohs(net_sin(&sock->src)->sin_port);
dst_port = ntohs(net_sin(&sock->dst)->sin_port);