summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2023-06-09 01:26:04 +0200
committerUwe Kleine-König <u.kleine-koenig@pengutronix.de>2023-06-10 23:46:32 +0200
commitac3dd08369458df95349a2e080121f13dda76aa9 (patch)
treef77c30b6f75a3856ceba1d778d45baed5874b5af
parent5a3bc9d127fdf83f951d638d78fa00c882416609 (diff)
downloadmicrocom-ac3dd08369458df95349a2e080121f13dda76aa9.tar.gz
microcom-ac3dd08369458df95349a2e080121f13dda76aa9.tar.xz
telnet: Don't send DO COM_PORT_CONTROL
That request isn't sensible because microcom doesn't implement to be an UART access server. Both ser2net and Moxa UART servers reply with WONT COM_PORT_CONTROL to a DO, so the request is refused. To actually use the COM_PORT_CONTROL extension only a "client side" WILL (by microcom) and a "server side" DO (by the remote side) is necessary (and sensible). The rfc2217 document also reads: Typically a client will use WILL and WONT, while an access server will use DO and DONT. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
-rw-r--r--telnet.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/telnet.c b/telnet.c
index 0d8c2a3..7c25f27 100644
--- a/telnet.c
+++ b/telnet.c
@@ -596,11 +596,9 @@ struct ios_ops *telnet_init(char *hostport)
}
printf("connected to %s (port %s)\n", connected_host, connected_port);
- /* send intent to do and accept COM_PORT stuff */
+ /* send intent we WILL do COM_PORT stuff */
dbg_printf("-> WILL COM_PORT_CONTROL\n");
dprintf(sock, "%c%c%c", IAC, WILL, TELNET_OPTION_COM_PORT_CONTROL);
- dbg_printf("-> DO COM_PORT_CONTROL\n");
- dprintf(sock, "%c%c%c", IAC, DO, TELNET_OPTION_COM_PORT_CONTROL);
goto out;
}