diff options
author | peter <peter@FreeBSD.org> | 1998-03-22 06:51:57 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1998-03-22 06:51:57 +0000 |
commit | 47129697379a8b3b8a693c593abc3422a63ed9bf (patch) | |
tree | 8b3d96da2519ea277481a00ef3a775bbe704aa7f /sys/net/ppp_deflate.c | |
parent | 485f592474900427073918c54f598c8260bba25d (diff) | |
download | FreeBSD-src-47129697379a8b3b8a693c593abc3422a63ed9bf.zip FreeBSD-src-47129697379a8b3b8a693c593abc3422a63ed9bf.tar.gz |
ppp-2.3.x ships with a bad compression number for deflate. It uses number
24 (which is magnalink!) rather than the correct 26.
Initial attempt at a compatability kludge that will negotiate for either
but will prefer to use the correct deflate compression type.
Diffstat (limited to 'sys/net/ppp_deflate.c')
-rw-r--r-- | sys/net/ppp_deflate.c | 34 |
1 files changed, 29 insertions, 5 deletions
diff --git a/sys/net/ppp_deflate.c b/sys/net/ppp_deflate.c index 08d1f22..16cec0d 100644 --- a/sys/net/ppp_deflate.c +++ b/sys/net/ppp_deflate.c @@ -1,4 +1,4 @@ -/* $Id: ppp_deflate.c,v 1.6 1997/10/28 15:58:32 bde Exp $ */ +/* $Id: ppp_deflate.c,v 1.7 1998/03/21 20:56:14 peter Exp $ */ /* * ppp_deflate.c - interface the zlib procedures for Deflate compression @@ -97,6 +97,26 @@ struct compressor ppp_deflate = { z_incomp, /* incomp */ z_comp_stats, /* decomp_stat */ }; +#ifdef CI_BADDEFLATE +struct compressor ppp_baddeflate = { + CI_BADDEFLATE, /* compress_proto */ + z_comp_alloc, /* comp_alloc */ + z_comp_free, /* comp_free */ + z_comp_init, /* comp_init */ + z_comp_reset, /* comp_reset */ + z_compress, /* compress */ + z_comp_stats, /* comp_stat */ + z_decomp_alloc, /* decomp_alloc */ + z_decomp_free, /* decomp_free */ + z_decomp_init, /* decomp_init */ + z_decomp_reset, /* decomp_reset */ + z_decompress, /* decompress */ + z_incomp, /* incomp */ + z_comp_stats, /* decomp_stat */ +}; +#else +#define CI_BADDEFLATE CI_DEFLATE /* reduce #ifdef's, let gcc optimize */ +#endif /* * Space allocation and freeing routines for use by zlib routines. @@ -131,7 +151,8 @@ z_comp_alloc(options, opt_len) struct deflate_state *state; int w_size; - if (opt_len != CILEN_DEFLATE || options[0] != CI_DEFLATE + if (opt_len != CILEN_DEFLATE + || (options[0] != CI_DEFLATE && options[0] != CI_BADDEFLATE) || options[1] != CILEN_DEFLATE || DEFLATE_METHOD(options[2]) != DEFLATE_METHOD_VAL || options[3] != DEFLATE_CHK_SEQUENCE) @@ -177,7 +198,8 @@ z_comp_init(arg, options, opt_len, unit, hdrlen, debug) { struct deflate_state *state = (struct deflate_state *) arg; - if (opt_len < CILEN_DEFLATE || options[0] != CI_DEFLATE + if (opt_len < CILEN_DEFLATE + || (options[0] != CI_DEFLATE && options[0] != CI_BADDEFLATE) || options[1] != CILEN_DEFLATE || DEFLATE_METHOD(options[2]) != DEFLATE_METHOD_VAL || DEFLATE_SIZE(options[2]) != state->w_size @@ -362,7 +384,8 @@ z_decomp_alloc(options, opt_len) struct deflate_state *state; int w_size; - if (opt_len != CILEN_DEFLATE || options[0] != CI_DEFLATE + if (opt_len != CILEN_DEFLATE + || (options[0] != CI_DEFLATE && options[0] != CI_BADDEFLATE) || options[1] != CILEN_DEFLATE || DEFLATE_METHOD(options[2]) != DEFLATE_METHOD_VAL || options[3] != DEFLATE_CHK_SEQUENCE) @@ -407,7 +430,8 @@ z_decomp_init(arg, options, opt_len, unit, hdrlen, mru, debug) { struct deflate_state *state = (struct deflate_state *) arg; - if (opt_len < CILEN_DEFLATE || options[0] != CI_DEFLATE + if (opt_len < CILEN_DEFLATE + || (options[0] != CI_DEFLATE && options[0] != CI_BADDEFLATE) || options[1] != CILEN_DEFLATE || DEFLATE_METHOD(options[2]) != DEFLATE_METHOD_VAL || DEFLATE_SIZE(options[2]) != state->w_size |