diff --git a/drivers/net/telnet.c b/drivers/net/telnet.c index 6ab3ab2d016..d5a980c71b0 100644 --- a/drivers/net/telnet.c +++ b/drivers/net/telnet.c @@ -466,19 +466,9 @@ static ssize_t telnet_receive(FAR struct telnet_dev_s *priv, case STATE_DO: #ifdef CONFIG_TELNET_CHARACTER_MODE - if (ch == TELNET_SGA) + if (ch == TELNET_SGA || ch == TELNET_ECHO) { - /* If it received 'Suppress Go Ahead', reply with a WILL */ - - telnet_sendopt(priv, TELNET_WILL, ch); - - /* Also, send 'WILL ECHO' */ - - telnet_sendopt(priv, TELNET_WILL, TELNET_ECHO); - } - else if (ch == TELNET_ECHO) - { - /* If it received 'ECHO', then do nothing */ + /* If it received 'ECHO' or 'Suppress Go Ahead', then do nothing */ } else { @@ -1108,6 +1098,11 @@ static int telnet_session(FAR struct telnet_session_s *session) telnet_sendopt(priv, TELNET_DO, TELNET_NAWS); #endif +#ifdef CONFIG_TELNET_CHARACTER_MODE + telnet_sendopt(priv, TELNET_WILL, TELNET_SGA); + telnet_sendopt(priv, TELNET_WILL, TELNET_ECHO); +#endif + /* Has the I/O thread been started? */ if (g_telnet_io_kthread == (pid_t)0)