X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=modules%2Fvjcompress.c;h=0b170831d6ffaec9776f34889f640bdbd71305f8;hb=f6330ec2a89df650cd6bfeaa6538b8053aeb45c7;hp=66d3402886c22cdd81dc27b7996a81e1e7a150c6;hpb=a51ffdeea95fdbbb21555408d3e5002ad7069c8a;p=ppp.git diff --git a/modules/vjcompress.c b/modules/vjcompress.c index 66d3402..0b17083 100644 --- a/modules/vjcompress.c +++ b/modules/vjcompress.c @@ -29,7 +29,7 @@ * This version is used under SunOS 4.x, Digital UNIX, AIX 4.x, * and SVR4 systems including Solaris 2. * - * $Id: vjcompress.c,v 1.9 1996/06/26 00:53:17 paulus Exp $ + * $Id: vjcompress.c,v 1.11 2004/01/17 05:47:55 carlsonj Exp $ */ #include @@ -56,6 +56,10 @@ typedef u_long n_long; #include #endif +#ifdef SOL2 +#include +#endif + #include #include @@ -300,19 +304,19 @@ vj_compress_tcp(ip, mlen, comp, compress_cid, vjhdrp) * with it. */ goto uncompressed; - if (deltaS = (u_short)(ntohs(th->th_win) - ntohs(oth->th_win))) { + if ((deltaS = (u_short)(ntohs(th->th_win) - ntohs(oth->th_win))) > 0) { ENCODE(deltaS); changes |= NEW_W; } - if (deltaA = ntohl(th->th_ack) - ntohl(oth->th_ack)) { + if ((deltaA = ntohl(th->th_ack) - ntohl(oth->th_ack)) > 0) { if (deltaA > 0xffff) goto uncompressed; ENCODE(deltaA); changes |= NEW_A; } - if (deltaS = ntohl(th->th_seq) - ntohl(oth->th_seq)) { + if ((deltaS = ntohl(th->th_seq) - ntohl(oth->th_seq)) > 0) { if (deltaS > 0xffff) goto uncompressed; ENCODE(deltaS);