From d8a66adf98a0e525cf38031b42098d539da6eeb6 Mon Sep 17 00:00:00 2001 From: Paul Mackerras Date: Sun, 6 May 2012 17:32:26 +1000 Subject: [PATCH] pppd: Don't unconditionally disable VJ compression under Linux We were always clearing vjcomp if it was set, so VJ header compression was never getting enabled. This adds a pair of braces so it only gets disabled if there was an error. Reported by Stanislav Litvinenko. Signed-off-by: Paul Mackerras --- pppd/sys-linux.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pppd/sys-linux.c b/pppd/sys-linux.c index b675c97..4fe221d 100644 --- a/pppd/sys-linux.c +++ b/pppd/sys-linux.c @@ -2018,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; @@ -2041,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"); @@ -2233,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); -- 2.39.2