X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=pppd%2Fsys-str.c;h=e5831330cac83bc9922990ddd2aa188be84d4d95;hb=a7190159a848217af92e3aa11ce8c083e878fa06;hp=051f10dd306bd4ab688671ca0deee61eaa34dbd1;hpb=800ac338fdfc693ce08ede826907d7137c2c6f55;p=ppp.git diff --git a/pppd/sys-str.c b/pppd/sys-str.c index 051f10d..e583133 100644 --- a/pppd/sys-str.c +++ b/pppd/sys-str.c @@ -19,7 +19,7 @@ */ #ifndef lint -static char rcsid[] = "$Id: sys-str.c,v 1.18 1995/04/27 00:35:43 paulus Exp $"; +static char rcsid[] = "$Id: sys-str.c,v 1.20 1995/05/01 00:26:22 paulus Exp $"; #endif /* @@ -452,6 +452,15 @@ void restore_tty() { 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"); @@ -1107,6 +1116,8 @@ logwtmp(line, name, host) * network as `addr'. If we find any, we OR in their netmask to the * user-specified netmask. */ +#define MAX_IFS 32 + u_int32_t GetMask(addr) u_int32_t addr; @@ -1136,8 +1147,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. */