X-Git-Url: http://git.ozlabs.org/?p=ppp.git;a=blobdiff_plain;f=pppd%2Fsys-linux.c;h=9f04976e5b810139a04228e73a8b8e4bf2b68853;hp=34830f06ba0a11e94433b814397e00dd553071b5;hb=f5183e0e8535b77c836c309c1fec67a9fd9a1c13;hpb=416f33f79891785c39465e6b3f1010ee92fb78aa diff --git a/pppd/sys-linux.c b/pppd/sys-linux.c index 34830f0..9f04976 100644 --- a/pppd/sys-linux.c +++ b/pppd/sys-linux.c @@ -42,7 +42,7 @@ #include #include #include -#include +#include #include #include #include @@ -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"); @@ -1184,8 +1193,7 @@ GetMask(addr) return mask; } ifend = (struct ifreq *) (ifc.ifc_buf + ifc.ifc_len); - for (ifr = ifc.ifc_req; ifr < ifend; ifr = (struct ifreq *) - ((char *)&ifr->ifr_addr + ifr->ifr_addr.sa_len)) { + for (ifr = ifc.ifc_req; ifr < ifend; ifr++) { /* * Check the interface's internet address. */