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:
parent
20a69f6dbf
commit
806842b759
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue