Skip to content

Commit

Permalink
sys/net/telnet: disable local echo
Browse files Browse the repository at this point in the history
  • Loading branch information
benpicco committed Feb 2, 2024
1 parent c5c7fab commit 87ac088
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions sys/net/application_layer/telnet/telnet_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,17 @@ static void _process_cmd(uint8_t cmd, uint8_t option)
}
}

static void _send_opts(void)
{
if (IS_USED(MODULE_STDIO_TELNET)) {
/* RIOT will echo stdio, disable local echo */
const uint8_t opt_echo[] = {
TELNET_CMD_IAC, TELNET_CMD_WILL, TELNET_OPT_ECHO
};
_write_buffer(opt_echo, sizeof(opt_echo));
}
}

static void *telnet_thread(void *arg)
{
(void)arg;
Expand All @@ -210,6 +221,7 @@ static void *telnet_thread(void *arg)

DEBUG("connected\n");
_connected();
_send_opts();

bool is_cmd = false;
uint8_t is_option = 0;
Expand Down

0 comments on commit 87ac088

Please sign in to comment.