Commit 7d03e0c9 authored by Joris Guisson's avatar Joris Guisson

Use ntohs to convert the port from network byte order to host byte order, when...

Use ntohs to convert the port from network byte order to host byte order, when making an Address from a sockaddr_in
parent 37807cea
......@@ -85,7 +85,7 @@ Address::fromUnix(struct sockaddr* addr) {
struct sockaddr_in *in_addr = reinterpret_cast<struct sockaddr_in *>(addr);
std::string host = TRY_RET(inet_ntoa(in_addr->sin_addr));
int port = in_addr->sin_port;
int port = ntohs(in_addr->sin_port);
return Address(std::move(host), port);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment