提交 0f1b090b 编写于 作者: R Roman Bolshakov 提交者: Daniel P. Berrangé

tests: Don't test octal localhost IP in sockettest on macOS

getaddrinfo on macOS doesn't interpret octal IPv4 addresses. Only
inet_aton can be used for that. Therefore, from macOS standpoint
"0177.0.0.01" is not the same as "127.0.0.1".

The issue was also discovered by python and dotnet core:
  https://bugs.python.org/issue27612
  https://github.com/dotnet/corefx/issues/8362Signed-off-by: NRoman Bolshakov <r.bolshakov@yadro.com>
上级 51f27ef7
......@@ -465,7 +465,11 @@ mymain(void)
DO_TEST_LOCALHOST("127.0.0.1", true);
DO_TEST_LOCALHOST("2130706433", true);
/* Octal IPv4 doesn't work in getaddrinfo on macOS */
#ifndef __APPLE__
DO_TEST_LOCALHOST("0177.0.0.01", true);
#endif
DO_TEST_LOCALHOST("::1", true);
DO_TEST_LOCALHOST("0::1", true);
DO_TEST_LOCALHOST("0:0:0::1", true);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册