X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=linux%2Fbsd_comp.c;h=d622bff2641e0b18e2a6ad0842b4c145af606bf2;hb=580389b1f7f0351588e157360b2e7d452cc33a05;hp=508db4f622296ecea590c8a71467785b57e99b94;hpb=0f61ac5460e89dd768f1fb56fbdd8fa6f8af79f1;p=ppp.git diff --git a/linux/bsd_comp.c b/linux/bsd_comp.c index 508db4f..d622bff 100644 --- a/linux/bsd_comp.c +++ b/linux/bsd_comp.c @@ -37,7 +37,7 @@ */ /* - * This version is for use with contigious buffers on Linux-derived systems. + * This version is for use with contiguous buffers on Linux-derived systems. * * ==FILEVERSION 5== * @@ -49,7 +49,7 @@ * install a new bsd_comp.c file. Don't change the format of that * line otherwise, so the installation script can recognize it. * - * $Id: bsd_comp.c,v 1.2 1995/12/18 03:37:05 paulus Exp $ + * From: bsd_comp.c,v 1.3 1994/12/08 01:59:58 paulus Exp */ #ifndef MODULE @@ -78,7 +78,7 @@ #include #include -#include +#include #include #include @@ -92,9 +92,9 @@ #include #endif -#include -#include -#include +#include +#include +#include #undef PACKETPTR #define PACKETPTR 1 @@ -249,7 +249,6 @@ bsd_clear(struct bsd_db *db) db->n_bits = BSD_INIT_BITS; db->bytes_out = 0; db->in_count = 0; - db->incomp_count = 0; db->ratio = 0; db->checkpoint = CHECK_GAP; } @@ -684,7 +683,7 @@ static int bsd_compress (void *state, unsigned char *rptr, unsigned char *obuf, /* 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) { @@ -773,7 +772,7 @@ nomatch: 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;