X-Git-Url: http://git.ozlabs.org/?p=ppp.git;a=blobdiff_plain;f=pppd%2Fsys-linux.c;h=9f04976e5b810139a04228e73a8b8e4bf2b68853;hp=946a2f93033eb5e377208ba9e046bb8c0c36f3b7;hb=fe174917ff5bda0788993a27e21bf2451180938a;hpb=ed3c62f8932c151c211d064f95daed3f1f208f80 diff --git a/pppd/sys-linux.c b/pppd/sys-linux.c index 946a2f9..9f04976 100644 --- a/pppd/sys-linux.c +++ b/pppd/sys-linux.c @@ -399,6 +399,15 @@ void setdtr (int fd, int on) void restore_tty (void) { if (restore_term) { + if (!default_device) { + /* + * Turn off echoing, because otherwise we can get into + * a loop with the tty and the modem echoing to each other. + * We presume we are the sole user of this tty device, so + * when we close it, it will revert to its defaults anyway. + */ + inittermios.c_lflag &= ~(ECHO | ECHONL); + } if (tcsetattr(fd, TCSAFLUSH, &inittermios) < 0) if (errno != ENXIO) syslog(LOG_WARNING, "tcsetattr: %m");