From 2aeaa406fd35ae6bf032d467eb20c864c962d30c Mon Sep 17 00:00:00 2001 From: Chris Hall Date: Thu, 12 May 2011 20:11:05 +0100 Subject: Fix assert() in lib/vty_cli so does not go off during "write file" Previously, assert failed to take into account possible extra state of vty during "write file", so with particular sleight of hand could be persuaded to go off invalidly. --- lib/vty_cli.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lib/vty_cli.c') diff --git a/lib/vty_cli.c b/lib/vty_cli.c index b4791365..bdaf1128 100644 --- a/lib/vty_cli.c +++ b/lib/vty_cli.c @@ -373,7 +373,7 @@ extern enum vty_readiness uty_cli(vty_io vio) { VTY_ASSERT_LOCKED() ; - assert(vio->type == VTY_TERM) ; + assert((vio->type == VTY_TERM) || (vio->real_type == VTY_TERM)) ; if (vio->half_closed) return not_ready ; /* Nothing more if half closed */ @@ -411,7 +411,6 @@ static enum vty_readiness uty_cli_standard(vty_io vio) { VTY_ASSERT_LOCKED() ; - assert(vio->type == VTY_TERM) ; /* cli_blocked is set when is waiting for a command, or its output to * complete -- unless either of those has happened, is still blocked. -- cgit v1.2.3