]> git.puffer.fish Git - mirror/frr.git/commit
lib: simplify detection of when the user is leaving the CLI config mode
authorRenato Westphal <renato@opensourcerouting.org>
Sat, 19 Jan 2019 01:23:45 +0000 (23:23 -0200)
committerRenato Westphal <renato@opensourcerouting.org>
Tue, 19 Feb 2019 12:42:34 +0000 (09:42 -0300)
commitc2de8b21929abc788039114af958b57a7acd07b5
tree4cd5d86b12f7b024d463706988878e0c121440f9
parent3193c8b3d15920aad429d36670b535aebfae5248
lib: simplify detection of when the user is leaving the CLI config mode

We can make use of the vty->config variable to know when the CLI
user is in the configuration mode or not. This is much simpler
than obtaining this information from the vty node, and also a more
robust solution (the three switch statements below, for example,
were out of sync).

Also, fix a bug where vty->config wasn't being unset in the
vty_config_exit() function (bug introduced by commit f344c66ea3).

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
lib/command.c
lib/vty.c