On Thu, Jul 28, 2022 at 12:12:37PM -0500, Eric Blake wrote:
On Thu, Jul 28, 2022 at 03:19:08PM +0100, Richard W.M. Jones wrote:
> libnbd has long used MSG_NOSIGNAL to avoid receiving SIGPIPE if we
> accidentally write on a closed socket, which is a nice alternative to
> using a SIGPIPE signal handler. However with TLS connections, gnutls
> did not use this flag and so programs using libnbd + TLS would receive
> SIGPIPE in some situations, notably if the server closed the
> connection abruptly while we were trying to write something.
>
> GnuTLS 3.4.2 introduces GNUTLS_NO_SIGNAL which does the same thing.
> Use this flag if available.
>
> RHEL 7 has an older gnutls which lacks this flag. To avoid qemu-nbd
> interop tests failing (rarely, but more often with a forthcoming
> change to TLS shutdown behaviour), register a SIGPIPE signal handler
> in the test if the flag is missing.
Stale comment in the parenthesis?
Yes I'll fix that. In fact the test currently fails (intermittently)
in RHEL 7 because we don't yet have this patch.
Thanks,
Rich.
> ---
> interop/interop.c | 8 ++++++++
> lib/crypto.c | 7 ++++++-
> 2 files changed, 14 insertions(+), 1 deletion(-)
Reviewed-by: Eric Blake <eblake(a)redhat.com>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization:
qemu.org |
libvirt.org
--
Richard Jones, Virtualization Group, Red Hat
http://people.redhat.com/~rjones
Read my programming and virtualization blog:
http://rwmj.wordpress.com
nbdkit - Flexible, fast NBD server with plugins
https://gitlab.com/nbdkit/nbdkit