This is required to make sure that we properly send the
XFRR_end_configuration tag to the daemons. Previously if the user had an
`exit` at the root level the parser would just drop out of the config
node and so XFRR_end_configuration, even if sent, would be ignored
Signed-off-by: Christian Hopps <chopps@labn.net>
(cherry picked from commit
315e9032e4087494063bbc6f7f52ec8c3d3ce757)
if (strmatch(vty_buf_trimmed, "end"))
continue;
+ if (strmatch(vty_buf_trimmed, "exit") &&
+ vty->node == CONFIG_NODE) {
+ fprintf(stderr, "line %d: Warning[%d]...: %s\n", lineno,
+ vty->node, "early exit from config file");
+ break;
+ }
+
ret = command_config_read_one_line(vty, &cmd, lineno, 1);
switch (ret) {