[PATCH] D119461: [compiler-rt] Fix endianness in get_sock_peer_name test

Michał Górny via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 10 11:16:22 PST 2022


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGc65fb0cdf262: [compiler-rt] Fix endianness in get_sock_peer_name test (authored by mgorny).
Herald added a project: Sanitizers.
Herald added a subscriber: Sanitizers.

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119461/new/

https://reviews.llvm.org/D119461

Files:
  compiler-rt/test/sanitizer_common/TestCases/Linux/get_sock_peer_name.cpp


Index: compiler-rt/test/sanitizer_common/TestCases/Linux/get_sock_peer_name.cpp
===================================================================
--- compiler-rt/test/sanitizer_common/TestCases/Linux/get_sock_peer_name.cpp
+++ 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<const sockaddr *>(&sin), sizeof(sin)) ==


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D119461.407613.patch
Type: text/x-patch
Size: 663 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220210/f63b36f4/attachment-0001.bin>


More information about the cfe-commits mailing list