X-Git-Url: http://git.ozlabs.org/?p=ppp.git;a=blobdiff_plain;f=modules%2Fvjcompress.c;h=0b170831d6ffaec9776f34889f640bdbd71305f8;hp=eecbef5b35868589936692ce02783d0ac7da2546;hb=224841f4799f4f1e2e71bc490c54448d66740f4f;hpb=31e80dd05aec83cbee14a9ede031023188e31270 diff --git a/modules/vjcompress.c b/modules/vjcompress.c index eecbef5..0b17083 100644 --- a/modules/vjcompress.c +++ b/modules/vjcompress.c @@ -26,10 +26,10 @@ */ /* - * This version is used under SunOS 4.x, DEC Alpha OSF/1, AIX 4.x, + * This version is used under SunOS 4.x, Digital UNIX, AIX 4.x, * and SVR4 systems including Solaris 2. * - * $Id: vjcompress.c,v 1.8 1996/05/24 07:04:26 paulus Exp $ + * $Id: vjcompress.c,v 1.11 2004/01/17 05:47:55 carlsonj Exp $ */ #include @@ -44,7 +44,7 @@ #endif #endif -#ifdef OSF1 +#ifdef __osf__ #include #endif #include @@ -56,6 +56,10 @@ typedef u_long n_long; #include #endif +#ifdef SOL2 +#include +#endif + #include #include @@ -75,7 +79,7 @@ typedef u_long n_long; #define ovbcopy bcopy #endif -#ifdef OSF1 +#ifdef __osf__ #define getip_hl(base) (((base).ip_vhl)&0xf) #define getth_off(base) ((((base).th_xoff)&0xf0)>>4) @@ -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);