# HG changeset patch # User Tomas Kuthan # Date 1445113242 25200 # Node ID 0224a36cbe09fd7a79ef4cb059bac3537aea16aa # Parent 6445e44cfccd43b2f4d04fa1eb69bf6c9cf99736 21861322 OpenSSH client hangs on broken pipe diff -r 6445e44cfccd -r 0224a36cbe09 components/openssh/patches/032-hang_on_closed_output.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/components/openssh/patches/032-hang_on_closed_output.patch Sat Oct 17 13:20:42 2015 -0700 @@ -0,0 +1,25 @@ +# +# Fix possible hang on closed output. +# +# When there is a connectivity problem between the server and the client +# (network outage, server crash or reboot), the client indefinitely hangs. +# +# This patch fixes the issue by checking ssh_packet_write_poll return value +# in ssh_packet_write_wait and passing it through. +# +# The (updated) patch has been accepted upstream and will be part of 7.2 +# https://github.com/openssh/openssh-portable/commit/8408218 +# +diff -pur old/packet.c new/packet.c +--- old/packet.c ++++ new/packet.c +@@ -2040,7 +2040,8 @@ ssh_packet_write_wait(struct ssh *ssh) + NFDBITS), sizeof(fd_mask)); + if (setp == NULL) + return SSH_ERR_ALLOC_FAIL; +- ssh_packet_write_poll(ssh); ++ if ((r = ssh_packet_write_poll(ssh)) != 0) ++ return r; + while (ssh_packet_have_data_to_write(ssh)) { + memset(setp, 0, howmany(state->connection_out + 1, + NFDBITS) * sizeof(fd_mask));