]> git.ozlabs.org Git - ppp.git/commitdiff
add log level arg for log_packet; set IP mtu in ppp_send_config
authorPaul Mackerras <paulus@samba.org>
Wed, 30 Apr 1997 05:58:52 +0000 (05:58 +0000)
committerPaul Mackerras <paulus@samba.org>
Wed, 30 Apr 1997 05:58:52 +0000 (05:58 +0000)
pppd/sys-osf.c
pppd/sys-sunos4.c

index b328ebb18e87b271413fed7ab5086fa6d69996db..42acdd85fb6b7ff0017716e8ee45ecacc9a0f162 100644 (file)
@@ -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 <stdio.h>
@@ -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);
index 8724de55e950486800dc3abba6fe478d3d7bbe9d..74c0217ef2908d7c5ae160164b53dc0a42fec180 100644 (file)
@@ -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 <stdio.h>
@@ -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;