mirror of
https://github.com/apache/nuttx.git
synced 2026-05-28 20:08:15 +08:00
drivers/net/telnet.c: Trigger SGA and ECHO proactively in the character mode
Trigger SGA and ECHO proactively in character mode otherwise Ubuntu bultin telnet can't enter this mode Change-Id: I8aa2ab2b31c35007077c701c264b3971152435f0 Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
+7
-12
@@ -466,19 +466,9 @@ static ssize_t telnet_receive(FAR struct telnet_dev_s *priv,
|
|||||||
|
|
||||||
case STATE_DO:
|
case STATE_DO:
|
||||||
#ifdef CONFIG_TELNET_CHARACTER_MODE
|
#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 */
|
/* If it received 'ECHO' or 'Suppress Go Ahead', then do nothing */
|
||||||
|
|
||||||
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 */
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -1108,6 +1098,11 @@ static int telnet_session(FAR struct telnet_session_s *session)
|
|||||||
telnet_sendopt(priv, TELNET_DO, TELNET_NAWS);
|
telnet_sendopt(priv, TELNET_DO, TELNET_NAWS);
|
||||||
#endif
|
#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? */
|
/* Has the I/O thread been started? */
|
||||||
|
|
||||||
if (g_telnet_io_kthread == (pid_t)0)
|
if (g_telnet_io_kthread == (pid_t)0)
|
||||||
|
|||||||
Reference in New Issue
Block a user