diff options
-rw-r--r-- | networking/telnetd.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/networking/telnetd.c b/networking/telnetd.c index bd60c8681..e94d3bd3d 100644 --- a/networking/telnetd.c +++ b/networking/telnetd.c | |||
@@ -278,9 +278,14 @@ safe_write_to_pty_decode_iac(struct tsession *ts) | |||
278 | goto update_and_return; | 278 | goto update_and_return; |
279 | } | 279 | } |
280 | if (buf[1] == AYT) { | 280 | if (buf[1] == AYT) { |
281 | /* Send back evidence that AYT was seen. */ | 281 | if (ts->size2 == 0) { /* if nothing buffered yet... */ |
282 | buf[1] = NOP; | 282 | /* Send back evidence that AYT was seen */ |
283 | /*rc =*/ safe_write(ts->sockfd_write, buf, 2); | 283 | unsigned char *buf2 = TS_BUF2(ts); |
284 | buf2[0] = IAC; | ||
285 | buf2[1] = NOP; | ||
286 | ts->wridx2 = 0; | ||
287 | ts->rdidx2 = ts->size2 = 2; | ||
288 | } | ||
284 | rc = 2; | 289 | rc = 2; |
285 | goto update_and_return; | 290 | goto update_and_return; |
286 | } | 291 | } |