summaryrefslogtreecommitdiff
path: root/lib/vty.h
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2018-10-11 09:43:32 -0400
committerDonald Sharp <sharpd@cumulusnetworks.com>2018-10-11 09:46:40 -0400
commit7ab57d19ce694b4fb2b15e98647571ea230e422f (patch)
treee756f4fb6381c750943edb776e41a64ef56c402e /lib/vty.h
parent8a7599cd2753f7390d6783a18c1db8662027424e (diff)
lib, vtysh: Allow notification across multiple lines of failure
When reading in config files and we have failures on multiple lines actually note the actual failure lines and return them. This fixes an issue where we stopped counting errors after the first one and we got missleading line numbers that did not correspond to the actual problem. This is fixed: sharpd@donna ~/frr> sudo /usr/lib/frr/pimd --log=stdout -A 127.0.0.1 -f /etc/frr/pimd.conf 2018/10/11 09:41:01 PIM: VRF Created: default(0) 2018/10/11 09:41:01 PIM: pim_vrf_enable: for default 2018/10/11 09:41:01 PIM: zclient_lookup_sched_now: zclient lookup immediate connection scheduled 2018/10/11 09:41:01 PIM: zclient_lookup_new: zclient lookup socket initialized 2018/10/11 09:41:01 PIM: pimd 6.1-dev starting: vty@2611 2018/10/11 09:41:01 PIM: [EC 100663304] ERROR: No such command on config line 2: inteface lo 2018/10/11 09:41:01 PIM: [EC 100663304] ERROR: No such command on config line 3: ip igmp 2018/10/11 09:41:01 PIM: [EC 100663304] ERROR: No such command on config line 4: ip igmp join 224.1.1.1 13.13.13.2 ^C2018/10/11 09:45:09 PIM: Terminating on signal SIGINT 2018/10/11 09:45:09 PIM: VRF Deletion: default(0) Fixes: #3161 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'lib/vty.h')
-rw-r--r--lib/vty.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/vty.h b/lib/vty.h
index b55abf2204..efe91a568b 100644
--- a/lib/vty.h
+++ b/lib/vty.h
@@ -33,6 +33,11 @@
#define VTY_BUFSIZ 4096
#define VTY_MAXHIST 20
+struct vty_error {
+ char error_buf[VTY_BUFSIZ];
+ uint32_t line_num;
+};
+
/* VTY struct. */
struct vty {
/* File descripter of this vty. */
@@ -71,7 +76,7 @@ struct vty {
char *buf;
/* Command input error buffer */
- char *error_buf;
+ struct list *error;
/* Command cursor point */
int cp;