X-Git-Url: http://git.ozlabs.org/?p=ppp.git;a=blobdiff_plain;f=pppd%2Fsys-osf.c;h=6d882a95c3af914e9bf105ced7c78d7df019de7a;hp=d9bdd30b12e2068f960861f918bb64e80f5ab721;hb=de7942371374241e49ab63439c35b142882f150c;hpb=e8be982dbc5c6c50dfc9f66737867570c8ed4973 diff --git a/pppd/sys-osf.c b/pppd/sys-osf.c index d9bdd30..6d882a9 100644 --- a/pppd/sys-osf.c +++ b/pppd/sys-osf.c @@ -26,7 +26,7 @@ */ #ifndef lint -static char rcsid[] = "$Id: sys-osf.c,v 1.25 1999/04/12 06:24:50 paulus Exp $"; +static char rcsid[] = "$Id: sys-osf.c,v 1.27 1999/05/12 06:16:16 paulus Exp $"; #endif #include @@ -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; + } + } } /* @@ -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;