* [Buildroot] [PATCH] package/libssh: add patch to fix regression
@ 2020-04-21 8:46 Heiko Thiery
2020-04-21 20:30 ` Thomas Petazzoni
2020-05-06 5:04 ` Peter Korsgaard
0 siblings, 2 replies; 3+ messages in thread
From: Heiko Thiery @ 2020-04-21 8:46 UTC (permalink / raw)
To: buildroot
The libssh server is used by libnetconf2. With libssh version 0.9.4 a
regression was introduced that wrongly leads to session closed after the
poll timeout.
The patch comes from upstrem:
https://git.libssh.org/projects/libssh.git/commit/?id=6417f5a3cac8537ac6f6ff7fc1642dfaa0917fb4
Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
---
...eturning-SSH_AGAIN-from-ssh_channel_.patch | 45 +++++++++++++++++++
1 file changed, 45 insertions(+)
create mode 100644 package/libssh/0002-channels-Avoid-returning-SSH_AGAIN-from-ssh_channel_.patch
diff --git a/package/libssh/0002-channels-Avoid-returning-SSH_AGAIN-from-ssh_channel_.patch b/package/libssh/0002-channels-Avoid-returning-SSH_AGAIN-from-ssh_channel_.patch
new file mode 100644
index 0000000000..9cc9389479
--- /dev/null
+++ b/package/libssh/0002-channels-Avoid-returning-SSH_AGAIN-from-ssh_channel_.patch
@@ -0,0 +1,45 @@
+From 6417f5a3cac8537ac6f6ff7fc1642dfaa0917fb4 Mon Sep 17 00:00:00 2001
+From: Jakub Jelen <jjelen@redhat.com>
+Date: Thu, 16 Apr 2020 11:13:34 +0200
+Subject: [PATCH] channels: Avoid returning SSH_AGAIN from
+ ssh_channel_poll_timeout()
+
+This addresses a regression introduced in 3bad0607, partially fixed in 022409e9,
+but the function was still able to return SSH_AGAIN, which was not expected by
+callers.
+
+Based on discussion in [1] and [2]
+
+[1] https://gitlab.com/libssh/libssh-mirror/-/merge_requests/101
+[2] https://www.libssh.org/archive/libssh/2020-03/0000029.html
+
+Signed-off-by: Jakub Jelen <jjelen@redhat.com>
+Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
+
+[Backport from upstream commit:
+6417f5a3cac8537ac6f6ff7fc1642dfaa0917fb4]
+Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
+---
+ src/channels.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/src/channels.c b/src/channels.c
+index bcc1c207..9fe309d0 100644
+--- a/src/channels.c
++++ b/src/channels.c
+@@ -3116,6 +3116,12 @@ int ssh_channel_poll_timeout(ssh_channel channel, int timeout, int is_stderr)
+ session->session_state == SSH_SESSION_STATE_ERROR) {
+ rc = SSH_ERROR;
+ goto out;
++ } else if (rc == SSH_AGAIN) {
++ /* If the above timeout expired, it is ok and we do not need to
++ * attempt to check the read buffer. The calling functions do not
++ * expect us to return SSH_AGAIN either here. */
++ rc = SSH_OK;
++ goto out;
+ }
+ len = ssh_buffer_get_len(stdbuf);
+ if (len > 0) {
+--
+2.20.1
+
--
2.20.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [Buildroot] [PATCH] package/libssh: add patch to fix regression
2020-04-21 8:46 [Buildroot] [PATCH] package/libssh: add patch to fix regression Heiko Thiery
@ 2020-04-21 20:30 ` Thomas Petazzoni
2020-05-06 5:04 ` Peter Korsgaard
1 sibling, 0 replies; 3+ messages in thread
From: Thomas Petazzoni @ 2020-04-21 20:30 UTC (permalink / raw)
To: buildroot
On Tue, 21 Apr 2020 10:46:51 +0200
Heiko Thiery <heiko.thiery@gmail.com> wrote:
> The libssh server is used by libnetconf2. With libssh version 0.9.4 a
> regression was introduced that wrongly leads to session closed after the
> poll timeout.
>
> The patch comes from upstrem:
> https://git.libssh.org/projects/libssh.git/commit/?id=6417f5a3cac8537ac6f6ff7fc1642dfaa0917fb4
>
> Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
> ---
> ...eturning-SSH_AGAIN-from-ssh_channel_.patch | 45 +++++++++++++++++++
> 1 file changed, 45 insertions(+)
> create mode 100644 package/libssh/0002-channels-Avoid-returning-SSH_AGAIN-from-ssh_channel_.patch
Applied to master, thanks.
Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Buildroot] [PATCH] package/libssh: add patch to fix regression
2020-04-21 8:46 [Buildroot] [PATCH] package/libssh: add patch to fix regression Heiko Thiery
2020-04-21 20:30 ` Thomas Petazzoni
@ 2020-05-06 5:04 ` Peter Korsgaard
1 sibling, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2020-05-06 5:04 UTC (permalink / raw)
To: buildroot
>>>>> "Heiko" == Heiko Thiery <heiko.thiery@gmail.com> writes:
> The libssh server is used by libnetconf2. With libssh version 0.9.4 a
> regression was introduced that wrongly leads to session closed after the
> poll timeout.
> The patch comes from upstrem:
> https://git.libssh.org/projects/libssh.git/commit/?id=6417f5a3cac8537ac6f6ff7fc1642dfaa0917fb4
> Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
Committed to 2020.02.x, thanks.
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-05-06 5:04 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-21 8:46 [Buildroot] [PATCH] package/libssh: add patch to fix regression Heiko Thiery
2020-04-21 20:30 ` Thomas Petazzoni
2020-05-06 5:04 ` Peter Korsgaard
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.