summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2019-07-30 10:29:38 +0700
committerVadim Yanitskiy <axilirator@gmail.com>2019-07-30 17:17:15 +0000
commit8c00f9d7535b366f15f9ad33a946b03893d684e5 (patch)
tree170dd1420b4d89704cb6572a54fc7ebd863bd103
parent757dea8d4abf611f40f39a128a970f8a6cb3c547 (diff)
vty/vty.c: the command buffer can be accessed directly
Change-Id: Ic6d7d68e9a559a6fb5bd6eaf6eccceae51e7ed39
-rw-r--r--src/vty/vty.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/vty/vty.c b/src/vty/vty.c
index b1bb3f49..a96d86ce 100644
--- a/src/vty/vty.c
+++ b/src/vty/vty.c
@@ -136,7 +136,7 @@ out:
}
/* Authentication of vty */
-static void vty_auth(struct vty *vty, char *buf)
+static void vty_auth(struct vty *vty)
{
char *passwd = NULL;
enum node_type next_node = 0;
@@ -170,10 +170,10 @@ static void vty_auth(struct vty *vty, char *buf)
if (passwd) {
#ifdef VTY_CRYPT_PW
if (host.encrypt)
- fail = strcmp(crypt(buf, passwd), passwd);
+ fail = strcmp(crypt(vty->buf, passwd), passwd);
else
#endif
- fail = strcmp(buf, passwd);
+ fail = strcmp(vty->buf, passwd);
} else
fail = 1;
@@ -417,13 +417,13 @@ static void vty_prompt(struct vty *vty)
}
/* Command execution over the vty interface. */
-static int vty_command(struct vty *vty, char *buf)
+static int vty_command(struct vty *vty)
{
int ret;
vector vline;
/* Split readline string up into the vector */
- vline = cmd_make_strvec(buf);
+ vline = cmd_make_strvec(vty->buf);
if (vline == NULL)
return CMD_SUCCESS;
@@ -689,10 +689,10 @@ static int vty_execute(struct vty *vty)
switch (vty->node) {
case AUTH_NODE:
case AUTH_ENABLE_NODE:
- vty_auth(vty, vty->buf);
+ vty_auth(vty);
break;
default:
- ret = vty_command(vty, vty->buf);
+ ret = vty_command(vty);
if (vty->type == VTY_TERM)
vty_hist_add(vty);
break;