From 7f6da094bad38e3593e475a81a28f1833d911c46 Mon Sep 17 00:00:00 2001 From: paulo Date: Thu, 10 Dec 2009 14:25:48 +0000 Subject: Needed unprotected version of vty_reset for use in vty_terminate --- lib/vty.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'lib/vty.c') diff --git a/lib/vty.c b/lib/vty.c index b5ef87c8..45a5da0f 100644 --- a/lib/vty.c +++ b/lib/vty.c @@ -100,6 +100,7 @@ static int uty_timeout (struct vty *vty); static void vty_timeout_r (qtimer qtr, void* timer_info, qtime_t when); static void vty_read_r (qps_file qf, void* file_info); static void vty_flush_r (qps_file qf, void* file_info); +void uty_reset (void); /* Extern host structure from command.c */ extern struct host host; @@ -3344,14 +3345,20 @@ struct cmd_node vty_node = /* Reset all VTY status. */ void vty_reset () +{ + LOCK + uty_reset(); + UNLOCK +} + +void +uty_reset () { unsigned int i; struct vty *vty; struct thread *vty_serv_thread; qps_file qf; - LOCK - for (i = 0; i < vector_active (vtyvec); i++) if ((vty = vector_slot (vtyvec, i)) != NULL) { @@ -3396,7 +3403,6 @@ vty_reset () XFREE(MTYPE_VTY, vty_ipv6_accesslist_name); vty_ipv6_accesslist_name = NULL; } - UNLOCK } static void @@ -3538,7 +3544,7 @@ vty_terminate (void) if (vtyvec && Vvty_serv_thread) { - vty_reset (); + uty_reset (); vector_free (vtyvec); vector_free (Vvty_serv_thread); } -- cgit v1.2.3