summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorChris Hall <chris.hall@highwayman.com>2011-05-12 20:11:05 +0100
committerChris Hall <chris.hall@highwayman.com>2011-05-12 20:11:05 +0100
commit2aeaa406fd35ae6bf032d467eb20c864c962d30c (patch)
tree373c9c0c7fe6aa529f0a63fdc1ee7e6918a8b652 /lib
parentaf22333d1ffeb1248b2234d7cec7b90d305c2190 (diff)
downloadquagga-2aeaa406fd35ae6bf032d467eb20c864c962d30c.tar.bz2
quagga-2aeaa406fd35ae6bf032d467eb20c864c962d30c.tar.xz
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.
Diffstat (limited to 'lib')
-rw-r--r--lib/vty_cli.c3
1 files changed, 1 insertions, 2 deletions
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.