X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=pppd%2Fsys-osf.c;h=920b30af1315cadac88fb7003c554e024b7f5184;hb=33c08b5f78f41aab4d1172e66db7c1afe21b5f1c;hp=d9bdd30b12e2068f960861f918bb64e80f5ab721;hpb=e8be982dbc5c6c50dfc9f66737867570c8ed4973;p=ppp.git diff --git a/pppd/sys-osf.c b/pppd/sys-osf.c index d9bdd30..920b30a 100644 --- a/pppd/sys-osf.c +++ b/pppd/sys-osf.c @@ -25,9 +25,7 @@ * OR MODIFICATIONS. */ -#ifndef lint -static char rcsid[] = "$Id: sys-osf.c,v 1.25 1999/04/12 06:24:50 paulus Exp $"; -#endif +#define RCSID "$Id: sys-osf.c,v 1.30 1999/08/13 06:46:18 paulus Exp $" #include #include @@ -61,6 +59,8 @@ static char rcsid[] = "$Id: sys-osf.c,v 1.25 1999/04/12 06:24:50 paulus Exp $"; #include "pppd.h" +static const char rcsid[] = RCSID; + static int pppfd; static int fdmuxid = -1; static int iffd; @@ -375,6 +375,13 @@ establish_ppp(fd) if (i != fd && i != sockfd) close(i); closed_stdio = 1; + /* make sure 0, 1, 2 are open to /dev/null */ + while ((i = open("/dev/null", O_RDWR)) >= 0) { + if (i > 2) { + close(i); + break; + } + } } /* @@ -837,7 +844,7 @@ read_packet(buf) flags = 0; len = getmsg(pppfd, &ctrl, &data, &flags); if (len < 0) { - if (errno = EAGAIN || errno == EWOULDBLOCK || errno == EINTR) + if (errno == EAGAIN || errno == EWOULDBLOCK || errno == EINTR) return -1; fatal("Error reading packet: %m"); } @@ -1113,6 +1120,7 @@ sifdown(u) { struct ifreq ifr; + bzero(&ifr, sizeof(ifr)); strlcpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name)); if (ioctl(sockfd, SIOCGIFFLAGS, &ifr) < 0) { error("Couldn't mark interface down (get): %m"); @@ -1205,7 +1213,8 @@ sifaddr(u, o, h, m) ret = 0; } - ifr.ifr_metric = link_mtu; + ifr.ifr_data = (caddr_t)&link_mtu; + if (ioctl(sockfd, SIOCSIPMTU, &ifr) < 0) { error("Couldn't set IP MTU: %m"); ret = 0;