From e82a17c61b49e4bfa462bceac08ed7ae2a54e254 Mon Sep 17 00:00:00 2001 From: Quentin Young Date: Wed, 21 Jun 2017 20:06:44 +0000 Subject: [PATCH] lib: actually exit when asked to do so When vtysh sends 'exit' to a daemon, we set the vty->status to VTY_CLOSE but never actually close the connection. Lovely. Signed-off-by: Quentin Young --- lib/vty.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/vty.c b/lib/vty.c index 19f9223d37..54a5f727e1 100644 --- a/lib/vty.c +++ b/lib/vty.c @@ -2212,7 +2212,10 @@ vtysh_read (struct thread *thread) } } - vty_event (VTYSH_READ, sock, vty); + if (vty->status == VTY_CLOSE) + vty_close (vty); + else + vty_event (VTYSH_READ, sock, vty); return 0; } -- 2.39.5