drivers: wifi: esp_at: s/ntohs/htons/ after parsing port number

'struct sockaddr_in' should contain port number in network byte order. This
means that htons() macro should be used, instead of ntohs().

This was working before since both htons() and ntohs() end up in calling
BSWAP_16().

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
This commit is contained in:
Marcin Niestroj 2024-07-30 14:36:37 +02:00 committed by Carles Cufí
parent 20a69f6dbf
commit 806842b759
1 changed files with 1 additions and 1 deletions

View File

@ -544,7 +544,7 @@ MODEM_CMD_DIRECT_DEFINE(on_cmd_ciprecvdata)
struct sockaddr_in *recv_addr =
(struct sockaddr_in *) &sock->context->remote;
recv_addr->sin_port = ntohs(port);
recv_addr->sin_port = htons(port);
recv_addr->sin_family = AF_INET;
/* IP addr comes within quotation marks, which is disliked by