]> git.puffer.fish Git - mirror/frr.git/commit
lib: simplify detection of when the user is leaving the CLI config mode 3632/head
authorRenato Westphal <renato@opensourcerouting.org>
Sat, 19 Jan 2019 01:23:45 +0000 (23:23 -0200)
committerRenato Westphal <renato@opensourcerouting.org>
Sat, 19 Jan 2019 18:07:30 +0000 (16:07 -0200)
commitcf09d3ca45fa00c7474e5019534a339f48989c33
tree52a38d87d145ed54d4c300321422ef927c3998ef
parent41e195d47732fab800ce4f8bfd0b88561d2fab74
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