]> git.ozlabs.org Git - ppp.git/blobdiff - modules/vjcompress.c
Use systemd's sd_notify with option up_sdnotify
[ppp.git] / modules / vjcompress.c
index eecbef5b35868589936692ce02783d0ac7da2546..0b170831d6ffaec9776f34889f640bdbd71305f8 100644 (file)
  */
 
 /*
- * 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 <sys/types.h>
@@ -44,7 +44,7 @@
 #endif
 #endif
 
-#ifdef OSF1
+#ifdef __osf__
 #include <net/net_globals.h>
 #endif
 #include <netinet/in.h>
@@ -56,6 +56,10 @@ typedef u_long  n_long;
 #include <netinet/in_systm.h>
 #endif
 
+#ifdef SOL2
+#include <sys/sunddi.h>
+#endif
+
 #include <netinet/ip.h>
 #include <netinet/tcp.h>
 
@@ -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);