提交 968d1a23 编写于 作者: R Richard Levitte

Use the protocol we know rather than BIO_ADDRINFO_protocol(res)

Because some platforms won't will in any value in ai_protocol, there's
no point using it if we already know what it should be.
Reviewed-by: NRich Salz <rsalz@openssl.org>
上级 07aa1e04
......@@ -179,7 +179,7 @@ int init_client(int *sock, const char *host, const char *port,
&& (type == 0 || type == BIO_ADDRINFO_socktype(res)));
*sock = BIO_socket(BIO_ADDRINFO_family(ai), BIO_ADDRINFO_socktype(ai),
BIO_ADDRINFO_protocol(ai), 0);
protocol, 0);
if (*sock == INVALID_SOCKET) {
/* Maybe the kernel doesn't support the socket family, even if
* BIO_lookup() added it in the returned result...
......@@ -257,7 +257,7 @@ int do_server(int *accept_sock, const char *host, const char *port,
&& (type == 0 || type == BIO_ADDRINFO_socktype(res)));
asock = BIO_socket(BIO_ADDRINFO_family(res), BIO_ADDRINFO_socktype(res),
BIO_ADDRINFO_protocol(res), 0);
protocol, 0);
if (asock == INVALID_SOCKET
|| !BIO_listen(asock, BIO_ADDRINFO_address(res), BIO_SOCK_REUSEADDR)) {
BIO_ADDRINFO_free(res);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册