diff --git a/compiler-rt/test/sanitizer_common/TestCases/Linux/get_sock_peer_name.cpp b/compiler-rt/test/sanitizer_common/TestCases/Linux/get_sock_peer_name.cpp --- a/compiler-rt/test/sanitizer_common/TestCases/Linux/get_sock_peer_name.cpp +++ b/compiler-rt/test/sanitizer_common/TestCases/Linux/get_sock_peer_name.cpp @@ -17,10 +17,10 @@ const sockaddr_in sin = { .sin_family = AF_INET, - .sin_port = 1234, + .sin_port = htons(1234), .sin_addr = { - .s_addr = INADDR_LOOPBACK, + .s_addr = htonl(INADDR_LOOPBACK), }, }; assert(connect(fd, reinterpret_cast(&sin), sizeof(sin)) ==