From: Paul Mackerras Date: Wed, 30 Apr 1997 05:58:52 +0000 (+0000) Subject: add log level arg for log_packet; set IP mtu in ppp_send_config X-Git-Tag: RELEASE_2_3_6~193 X-Git-Url: http://git.ozlabs.org/?p=ppp.git;a=commitdiff_plain;h=01ab847385f3d3abe64dbf4bea5363da3e6e1d64 add log level arg for log_packet; set IP mtu in ppp_send_config --- diff --git a/pppd/sys-osf.c b/pppd/sys-osf.c index b328ebb..42acdd8 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.11 1997/03/04 03:43:53 paulus Exp $"; +static char rcsid[] = "$Id: sys-osf.c,v 1.12 1997/04/30 05:58:44 paulus Exp $"; #endif #include @@ -750,7 +750,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; @@ -981,6 +981,8 @@ ccp_test(unit, opt_ptr, opt_len, for_transmit) break; wait_time(&tval); } + if (errno != 0) + syslog(LOG_ERR, "hard failure trying to get memory for a compressor: %m"); return (errno == ENOSR)? 0: -1; } @@ -1186,6 +1188,12 @@ sifaddr(u, o, h, m) ret = 0; } + ifr.ifr_metric = link_mtu; + if (ioctl(sockfd, SIOCSIPMTU, &ifr) < 0) { + syslog(LOG_ERR, "Couldn't set IP MTU: %m"); + ret = 0; + } + ifaddrs[0] = o; ifaddrs[1] = h; return (ret); diff --git a/pppd/sys-sunos4.c b/pppd/sys-sunos4.c index 8724de5..74c0217 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.8 1997/04/30 05:58:52 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;