X-Git-Url: http://git.ozlabs.org/?p=ppp.git;a=blobdiff_plain;f=pppd%2Fsys-sunos4.c;h=a9d970ec91c44e1daef2d3b8083156ed29c8e3e9;hp=8724de55e950486800dc3abba6fe478d3d7bbe9d;hb=a25ab4af5d8ea4f1760b5db5f5ee5b65bbfcd53b;hpb=26a7a28f129d72feaa08ef589e9a49aafd16d984 diff --git a/pppd/sys-sunos4.c b/pppd/sys-sunos4.c index 8724de5..a9d970e 100644 --- a/pppd/sys-sunos4.c +++ b/pppd/sys-sunos4.c @@ -26,7 +26,7 @@ */ #ifndef lint -static char rcsid[] = "$Id: sys-sunos4.c,v 1.7 1997/03/04 03:43:54 paulus Exp $"; +static char rcsid[] = "$Id: sys-sunos4.c,v 1.9 1998/03/25 02:19:29 paulus Exp $"; #endif #include @@ -603,7 +603,7 @@ output(unit, p, len) struct pollfd pfd; if (debug) - log_packet(p, len, "sent "); + log_packet(p, len, "sent ", LOG_DEBUG); data.len = len; data.buf = (caddr_t) p; @@ -738,6 +738,7 @@ ppp_send_config(unit, mtu, asyncmap, pcomp, accomp) int pcomp, accomp; { int cf[2]; + struct ifreq ifr; link_mtu = mtu; if (strioctl(pppfd, PPPIO_MTU, &mtu, sizeof(mtu), 0) < 0) { @@ -753,6 +754,14 @@ ppp_send_config(unit, mtu, asyncmap, pcomp, accomp) if (strioctl(pppfd, PPPIO_CFLAGS, cf, sizeof(cf), sizeof(int)) < 0) { syslog(LOG_ERR, "Couldn't set prot/AC compression: %m"); } + + /* set mtu for ip as well */ + memset(&ifr, 0, sizeof(ifr)); + strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name)); + ifr.ifr_metric = link_mtu; + if (ioctl(sockfd, SIOCSIFMTU, &ifr) < 0) { + syslog(LOG_ERR, "Couldn't set IP MTU: %m"); + } } /* @@ -987,10 +996,12 @@ sifaddr(u, o, h, m) if (ioctl(sockfd, SIOCSIFDSTADDR, &ifr) < 0) { syslog(LOG_ERR, "Couldn't set remote IP address: %m"); } +#if 0 /* now done in ppp_send_config */ ifr.ifr_metric = link_mtu; if (ioctl(sockfd, SIOCSIFMTU, &ifr) < 0) { syslog(LOG_ERR, "Couldn't set IP MTU: %m"); } +#endif ifaddrs[0] = o; ifaddrs[1] = h; @@ -1315,6 +1326,15 @@ strioctl(fd, cmd, ptr, ilen, olen) return 0; } +/* + * Use the hostid as part of the random number seed. + */ +int +get_host_seed() +{ + return gethostid(); +} + /* * Code for locking/unlocking the serial device. * This code is derived from chat.c.