Commit 8604968a authored by Mathieu Stefani's avatar Mathieu Stefani Committed by GitHub

Merge pull request #45 from GeorgeKT/port-endianness-fix

Address::fromUnix gets the port wrong
parents 8c0d7ddf 7d03e0c9
......@@ -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