aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2019-04-04 16:00:23 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2019-04-04 16:00:23 +0200
commitc6a8965297f96f63403a1f17606838a0cb4444c5 (patch)
tree8e06c2c7dd9fd8fe2be5a78eaceb0a05a2a6d8b3
parent93594b1197cf3ae1835eedebbebb2b40ea2a81f7 (diff)
downloadbusybox-w32-c6a8965297f96f63403a1f17606838a0cb4444c5.tar.gz
busybox-w32-c6a8965297f96f63403a1f17606838a0cb4444c5.tar.bz2
busybox-w32-c6a8965297f96f63403a1f17606838a0cb4444c5.zip
telnetd: better AYT handling
function old new delta telnetd_main 1792 1837 +45 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--networking/telnetd.c11
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 }