提交 07aa1e04 编写于 作者: R Richard Levitte

Don't assert protocol equality

It seems that some platforms' getaddrinfo don't fill in the
ai_protocol field properly.  On those, the assertion
'protocol == BIO_ADDRINFO_protocol(res)' will fail.  Best to remove
it.
Reviewed-by: NKurt Roeckx <kurt@openssl.org>
上级 1c37fd96
...@@ -176,8 +176,7 @@ int init_client(int *sock, const char *host, const char *port, ...@@ -176,8 +176,7 @@ int init_client(int *sock, const char *host, const char *port,
not get anything in the BIO_ADDRINFO chain that we haven't not get anything in the BIO_ADDRINFO chain that we haven't
asked for */ asked for */
OPENSSL_assert((family == AF_UNSPEC || family == BIO_ADDRINFO_family(res)) OPENSSL_assert((family == AF_UNSPEC || family == BIO_ADDRINFO_family(res))
&& (type == 0 || type == BIO_ADDRINFO_socktype(res)) && (type == 0 || type == BIO_ADDRINFO_socktype(res)));
&& (protocol == BIO_ADDRINFO_protocol(res)));
*sock = BIO_socket(BIO_ADDRINFO_family(ai), BIO_ADDRINFO_socktype(ai), *sock = BIO_socket(BIO_ADDRINFO_family(ai), BIO_ADDRINFO_socktype(ai),
BIO_ADDRINFO_protocol(ai), 0); BIO_ADDRINFO_protocol(ai), 0);
...@@ -255,8 +254,7 @@ int do_server(int *accept_sock, const char *host, const char *port, ...@@ -255,8 +254,7 @@ int do_server(int *accept_sock, const char *host, const char *port,
not get anything in the BIO_ADDRINFO chain that we haven't not get anything in the BIO_ADDRINFO chain that we haven't
asked for */ asked for */
OPENSSL_assert((family == AF_UNSPEC || family == BIO_ADDRINFO_family(res)) OPENSSL_assert((family == AF_UNSPEC || family == BIO_ADDRINFO_family(res))
&& (type == 0 || type == BIO_ADDRINFO_socktype(res)) && (type == 0 || type == BIO_ADDRINFO_socktype(res)));
&& (protocol == BIO_ADDRINFO_protocol(res)));
asock = BIO_socket(BIO_ADDRINFO_family(res), BIO_ADDRINFO_socktype(res), asock = BIO_socket(BIO_ADDRINFO_family(res), BIO_ADDRINFO_socktype(res),
BIO_ADDRINFO_protocol(res), 0); BIO_ADDRINFO_protocol(res), 0);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册