]> git.ozlabs.org Git - ppp.git/commitdiff
fix counting of in/out bytes
authorPaul Mackerras <paulus@samba.org>
Wed, 26 Jun 1996 00:51:36 +0000 (00:51 +0000)
committerPaul Mackerras <paulus@samba.org>
Wed, 26 Jun 1996 00:51:36 +0000 (00:51 +0000)
linux/bsd_comp.c

index bab6561e3100cd1517481fc7141d83eccd07aec9..db15f1bdcf17fac8cac52ffa84b96c44dcfebaca 100644 (file)
@@ -39,7 +39,7 @@
 /*
  * This version is for use with contiguous buffers on Linux-derived systems.
  *
 /*
  * This version is for use with contiguous buffers on Linux-derived systems.
  *
- *  ==FILEVERSION 4==
+ *  ==FILEVERSION 5==
  *
  *  NOTE TO MAINTAINERS:
  *     If you modify this file at all, increment the number above.
  *
  *  NOTE TO MAINTAINERS:
  *     If you modify this file at all, increment the number above.
@@ -684,7 +684,7 @@ static int bsd_compress (void *state, unsigned char *rptr, unsigned char *obuf,
     /* Skip the input header */
     rptr  += PPP_HDRLEN;
     isize -= PPP_HDRLEN;
     /* Skip the input header */
     rptr  += PPP_HDRLEN;
     isize -= PPP_HDRLEN;
-    ilen   = ++isize; /* This is off by one, but that is what is in draft! */
+    ilen   = ++isize;  /* Low byte of protocol is counted as input */
 
     while (--ilen > 0)
       {
 
     while (--ilen > 0)
       {
@@ -773,7 +773,7 @@ nomatch:
     
     OUTPUT(ent);               /* output the last code */
 
     
     OUTPUT(ent);               /* output the last code */
 
-    db->bytes_out    += olen;  /* Do not count bytes from here */
+    db->bytes_out    += olen - PPP_HDRLEN - BSD_OVHD;
     db->uncomp_bytes += isize;
     db->in_count     += isize;
     ++db->uncomp_count;
     db->uncomp_bytes += isize;
     db->in_count     += isize;
     ++db->uncomp_count;