diff --git a/test/IXTest.cpp b/test/IXTest.cpp index 0b62e916..382ebf35 100644 --- a/test/IXTest.cpp +++ b/test/IXTest.cpp @@ -71,8 +71,14 @@ namespace ix int getAnyFreePort() { + // ASAN complains about getsockname +#if defined(__has_feature) +# if __has_feature(address_sanitizer) + static int defaultPort = 8090; + return defaultPort++; +# endif +#else int defaultPort = 8090; - int sockfd; if ((sockfd = socket(AF_INET, SOCK_STREAM, 0)) < 0) { @@ -116,6 +122,7 @@ namespace ix ::close(sockfd); return port; +#endif } int getFreePort()