diff options
| author | Quentin Young <qlyoung@cumulusnetworks.com> | 2016-10-06 18:39:31 +0000 |
|---|---|---|
| committer | Quentin Young <qlyoung@cumulusnetworks.com> | 2016-10-06 18:39:31 +0000 |
| commit | cbd7259d95886fe8438fd7d4e3ea75db2dae55f0 (patch) | |
| tree | eb784b84953d3f3c29d7dfcab720f9766e90db5d /lib/command.c | |
| parent | 56158e123546b04faf2ab8e009d41067d8cde5da (diff) | |
lib: Log invalid/unknown commands to log file
Ticket: CM-6855
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'lib/command.c')
| -rw-r--r-- | lib/command.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/command.c b/lib/command.c index f51b2c69ee..96ce661e4a 100644 --- a/lib/command.c +++ b/lib/command.c @@ -738,10 +738,6 @@ cmd_execute_command_real (vector vline, case MATCHER_AMBIGUOUS: return CMD_ERR_AMBIGUOUS; default: - {} // C... - char *inputline = cmd_concat_strvec (vline); - zlog_err ("invalid command \"%s\" for node %d\n", inputline, vty->node); - free (inputline); return CMD_ERR_NO_MATCH; } @@ -909,10 +905,12 @@ command_config_read_one_line (struct vty *vty, struct cmd_element **cmd, int use ret != CMD_WARNING) { vty->node = saved_node; - memcpy(vty->error_buf, vty->buf, VTY_BUFSIZ); } } + if (ret != CMD_SUCCESS && ret != CMD_WARNING) + memcpy (vty->error_buf, vty->buf, VTY_BUFSIZ); + cmd_free_strvec (vline); return ret; |
