Register the vtysh socket in Vvty_serv_thread so it will be
correctly closed on vty_reset instead of being leaked.
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
static char *vty_ipv6_accesslist_name = NULL;
/* VTY server thread. */
-vector Vvty_serv_thread;
+static vector Vvty_serv_thread;
/* Current directory. */
char *vty_cwd = NULL;
break;
#ifdef VTYSH
case VTYSH_SERV:
- thread_add_read (master, vtysh_accept, vty, sock);
+ vty_serv_thread = thread_add_read (master, vtysh_accept, vty, sock);
+ vector_set_index (Vvty_serv_thread, sock, vty_serv_thread);
break;
case VTYSH_READ:
vty->t_read = thread_add_read (master, vtysh_read, vty, sock);