break;
case SE:
{
- char *buffer = (char *)vty->sb_buffer->head->data;
- int length = vty->sb_buffer->length;
+ char *buffer;
+ int length;
- if (buffer == NULL)
+ if (!vty->iac_sb_in_progress)
return 0;
- if (!vty->iac_sb_in_progress)
+ buffer = (char *)vty->sb_buffer->head->data;
+ length = vty->sb_buffer->length;
+
+ if (buffer == NULL)
return 0;
if (buffer[0] == '\0')
vty_read (struct thread *thread)
{
int i;
- int ret;
int nbytes;
unsigned char buf[VTY_READ_BUFSIZ];
if (vty->iac)
{
/* In case of telnet command */
- ret = vty_telnet_option (vty, buf + i, nbytes - i);
+ int ret = 0;
+ if (vty->iac_sb_in_progress)
+ ret = vty_telnet_option (vty, buf + i, nbytes - i);
vty->iac = 0;
i += ret;
continue;
}
+
if (vty->status == VTY_MORE)
{