telnetd: Added support for AYT IAC command.
Fixed a TODO in AYT IAC handling by replying back with a NOP. Signed-off-by: Martin Lewis <martin.lewis.x84@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
committed by
Denys Vlasenko
parent
2b6282117f
commit
93594b1197
@@ -249,7 +249,7 @@ safe_write_to_pty_decode_iac(struct tsession *ts)
|
|||||||
* IAC SE (240) End of subnegotiation. Treated as NOP.
|
* IAC SE (240) End of subnegotiation. Treated as NOP.
|
||||||
* IAC NOP (241) NOP. Supported.
|
* IAC NOP (241) NOP. Supported.
|
||||||
* IAC BRK (243) Break. Like serial line break. TODO via tcsendbreak()?
|
* IAC BRK (243) Break. Like serial line break. TODO via tcsendbreak()?
|
||||||
* IAC AYT (246) Are you there. Send back evidence that AYT was seen. TODO (send NOP back)?
|
* IAC AYT (246) Are you there.
|
||||||
* These don't look useful:
|
* These don't look useful:
|
||||||
* IAC DM (242) Data mark. What is this?
|
* IAC DM (242) Data mark. What is this?
|
||||||
* IAC IP (244) Suspend, interrupt or abort the process. (Ancient cousin of ^C).
|
* IAC IP (244) Suspend, interrupt or abort the process. (Ancient cousin of ^C).
|
||||||
@@ -277,6 +277,13 @@ safe_write_to_pty_decode_iac(struct tsession *ts)
|
|||||||
rc = 2;
|
rc = 2;
|
||||||
goto update_and_return;
|
goto update_and_return;
|
||||||
}
|
}
|
||||||
|
if (buf[1] == AYT) {
|
||||||
|
/* Send back evidence that AYT was seen. */
|
||||||
|
buf[1] = NOP;
|
||||||
|
/*rc =*/ safe_write(ts->sockfd_write, buf, 2);
|
||||||
|
rc = 2;
|
||||||
|
goto update_and_return;
|
||||||
|
}
|
||||||
if (buf[1] >= 240 && buf[1] <= 249) {
|
if (buf[1] >= 240 && buf[1] <= 249) {
|
||||||
/* NOP (241). Ignore (putty keepalive, etc) */
|
/* NOP (241). Ignore (putty keepalive, etc) */
|
||||||
/* All other 2-byte commands also treated as NOPs here */
|
/* All other 2-byte commands also treated as NOPs here */
|
||||||
|
Reference in New Issue
Block a user