From: Hugo Landau Date: Thu, 14 Sep 2023 07:40:14 +0000 (+0100) Subject: BIO: Wire poll descriptor functions in BIO_s_sock X-Git-Tag: openssl-3.2.0-alpha2~49 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b79e73cfba2f17cc810bde3c50a2a1d4f03b8cae;p=thirdparty%2Fopenssl.git BIO: Wire poll descriptor functions in BIO_s_sock Reviewed-by: Tomas Mraz Reviewed-by: Matt Caswell Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/21979) --- diff --git a/crypto/bio/bss_sock.c b/crypto/bio/bss_sock.c index f64eb8c843a..4ff4defadff 100644 --- a/crypto/bio/bss_sock.c +++ b/crypto/bio/bss_sock.c @@ -215,6 +215,20 @@ static long sock_ctrl(BIO *b, int cmd, long num, void *ptr) case BIO_CTRL_FLUSH: ret = 1; break; + case BIO_CTRL_GET_RPOLL_DESCRIPTOR: + case BIO_CTRL_GET_WPOLL_DESCRIPTOR: + { + BIO_POLL_DESCRIPTOR *pd = ptr; + + if (!b->init) { + ret = 0; + break; + } + + pd->type = BIO_POLL_DESCRIPTOR_TYPE_SOCK_FD; + pd->value.fd = b->num; + } + break; # ifndef OPENSSL_NO_KTLS case BIO_CTRL_SET_KTLS: crypto_info = (ktls_crypto_info_t *)ptr;