提交 fbb27088 编写于 作者: G Guido Günther

virNetSocketCheckProtocols: handle EAI_NONAME as IPv6 unavailable

When running the test suite using "unshare -n" we might have IPv6 but no
configured addresses. Due to AI_ADDRCONFIG getaddrinfo then fails with
EAI_NONAME which we should then treat as IPv6 unavailable.
上级 bfaaa2b6
...@@ -183,7 +183,8 @@ int virNetSocketCheckProtocols(bool *hasIPv4, ...@@ -183,7 +183,8 @@ int virNetSocketCheckProtocols(bool *hasIPv4,
if ((gaierr = getaddrinfo("::1", NULL, &hints, &ai)) != 0) { if ((gaierr = getaddrinfo("::1", NULL, &hints, &ai)) != 0) {
if (gaierr == EAI_ADDRFAMILY || if (gaierr == EAI_ADDRFAMILY ||
gaierr == EAI_FAMILY) { gaierr == EAI_FAMILY ||
gaierr == EAI_NONAME) {
*hasIPv6 = false; *hasIPv6 = false;
} else { } else {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册