The pointer rpos in the socket io module is only restored if the rx_hook callback returns 1. Previously the cli_rx hook always returned 0. Guarantee by design that we return 1 if we are at the end of the socket buffer.
Signed-off-by: Kenth Eriksson <kenth.eriks...@infinera.com> --- sysdep/unix/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sysdep/unix/main.c b/sysdep/unix/main.c index cf5f4a3c..6a6d1d2b 100644 --- a/sysdep/unix/main.c +++ b/sysdep/unix/main.c @@ -422,7 +422,7 @@ static int cli_rx(sock *s, uint size UNUSED) { cli_kick(s->data); - return 0; + return s->rbuf+s->rbsize==s->rpos? 1 : 0; } static void -- 2.21.0