X-Git-Url: https://git.ozlabs.org/?p=ppp.git;a=blobdiff_plain;f=linux%2Fbsd_comp.c;h=d622bff2641e0b18e2a6ad0842b4c145af606bf2;hp=bab6561e3100cd1517481fc7141d83eccd07aec9;hb=c2a92a1f6789e7ae568f18d9daa7f9117339174a;hpb=6589bd3bbe86761cc41767a1400a69bbc985788a diff --git a/linux/bsd_comp.c b/linux/bsd_comp.c index bab6561..d622bff 100644 --- a/linux/bsd_comp.c +++ b/linux/bsd_comp.c @@ -39,7 +39,7 @@ /* * 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. @@ -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;