aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2013-09-06 16:51:58 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-09-08 10:33:24 +0200
commit2442e096585302dee6287495d1b3d03cb712dcda (patch)
tree8098c823e6ac859d89aba019d8b5b647626adda2
parent6145a2569fced13f18c4da200b9ba2070e643079 (diff)
vty: Rename is_config() to is_config_child()
The function is_config() returns 0 for CONFIG_NODE. Since that node is a config node, the function is renamed to resolve this.
-rw-r--r--src/vty/command.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/vty/command.c b/src/vty/command.c
index faa7c51c..7f502dbe 100644
--- a/src/vty/command.c
+++ b/src/vty/command.c
@@ -147,7 +147,7 @@ static int cmp_desc(const void *p, const void *q)
return strcmp(a->cmd, b->cmd);
}
-static int is_config(struct vty *vty)
+static int is_config_child(struct vty *vty)
{
if (vty->node <= CONFIG_NODE)
return 0;
@@ -2050,7 +2050,7 @@ cmd_execute_command(vector vline, struct vty *vty, struct cmd_element **cmd,
/* Go to parent for config nodes to attempt to find the right command */
while (ret != CMD_SUCCESS && ret != CMD_WARNING
- && is_config(vty)) {
+ && is_config_child(vty)) {
vty_go_parent(vty);
ret = cmd_execute_command_real(vline, vty, cmd);
tried = 1;
@@ -2198,7 +2198,7 @@ int config_from_file(struct vty *vty, FILE * fp)
/* Try again with setting node to CONFIG_NODE */
while (ret != CMD_SUCCESS && ret != CMD_WARNING
&& ret != CMD_ERR_NOTHING_TODO
- && vty->node != CONFIG_NODE && is_config(vty)) {
+ && is_config_child(vty)) {
vty_go_parent(vty);
ret = cmd_execute_command_strict(vline, vty, NULL);
}