]> git.ozlabs.org Git - ppp.git/blobdiff - pppd/sys-linux.c
pppd: Don't unconditionally disable VJ compression under Linux
[ppp.git] / pppd / sys-linux.c
index 67b50cb663fa827051dc4480116f72e259dfd516..4fe221d86549ba9efeb204db375e093eebfceba0 100644 (file)
@@ -1658,6 +1658,8 @@ int cifdefaultroute (int unit, u_int32_t ouraddr, u_int32_t gateway)
     SET_SA_FAMILY (rt.rt_dst,     AF_INET);
     SET_SA_FAMILY (rt.rt_gateway, AF_INET);
 
+    rt.rt_dev = ifname;
+
     if (kernel_version > KVERSION(2,1,0)) {
        SET_SA_FAMILY (rt.rt_genmask, AF_INET);
        SIN_ADDR(rt.rt_genmask) = 0L;
@@ -2016,7 +2018,7 @@ ppp_registered(void)
 
 int ppp_available(void)
 {
-    int s, ok, fd, err;
+    int s, ok, fd;
     struct ifreq ifr;
     int    size;
     int    my_version, my_modification, my_patch;
@@ -2039,7 +2041,6 @@ int ppp_available(void)
        close(fd);
        return 1;
     }
-    err = errno;
 
     if (kernel_version >= KVERSION(2,3,13)) {
        error("Couldn't open the /dev/ppp device: %m");
@@ -2231,9 +2232,10 @@ int sifvjcomp (int u, int vjcomp, int cidcomp, int maxcid)
        u_int x;
 
        if (vjcomp) {
-               if (ioctl(ppp_dev_fd, PPPIOCSMAXCID, (caddr_t) &maxcid) < 0)
+               if (ioctl(ppp_dev_fd, PPPIOCSMAXCID, (caddr_t) &maxcid) < 0) {
                        error("Couldn't set up TCP header compression: %m");
-               vjcomp = 0;
+                       vjcomp = 0;
+               }
        }
 
        x = (vjcomp? SC_COMP_TCP: 0) | (cidcomp? 0: SC_NO_TCP_CCID);