From 8304b1e3e9f942b33a684c5d1129159abd1a3efd Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Sat, 4 Sep 2010 11:19:39 +0800 Subject: vty: Everything <= CONFIG_NODE is not a child of config The method should be renamed to is child of config node as it was comparing if vty->node > CONFIG_NODE. This is fixing an assert in go_to_parent as we tried to find a parent for the CONFIG_NODE. --- src/vty/command.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/vty/command.c b/src/vty/command.c index c55e1648..7525df65 100644 --- a/src/vty/command.c +++ b/src/vty/command.c @@ -141,9 +141,9 @@ static int cmp_desc(const void *p, const void *q) static int is_config(struct vty *vty) { - if (vty->node < CONFIG_NODE) + if (vty->node <= CONFIG_NODE) return 0; - else if (vty->node >= CONFIG_NODE && vty->node < _LAST_OSMOVTY_NODE) + else if (vty->node > CONFIG_NODE && vty->node < _LAST_OSMOVTY_NODE) return 1; else if (host.app_info->is_config_node) return host.app_info->is_config_node(vty, vty->node); -- cgit v1.2.3