summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChristian Franke <chris@opensourcerouting.org>2013-02-27 13:47:23 +0000
committerDavid Lamparter <equinox@opensourcerouting.org>2013-04-09 22:35:29 +0200
commit677bcbbf153fe73e57cb44f668977cbd26661fd4 (patch)
tree545636b73b23f02c3ec13261c71ec3058cf089b7 /lib
parentb68da446e977f8069fb72bce73402e2234ffc1d9 (diff)
lib/vty: register vtysh socket in server socket vector (BZ#754)
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>
Diffstat (limited to 'lib')
-rw-r--r--lib/vty.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/vty.c b/lib/vty.c
index 70bf5645..0d6345c8 100644
--- a/lib/vty.c
+++ b/lib/vty.c
@@ -71,7 +71,7 @@ static char *vty_accesslist_name = NULL;
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;
@@ -2509,7 +2509,8 @@ vty_event (enum event event, int sock, struct vty *vty)
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);