From 30f088ad7bc38164fba1bda3e8d767e2ab1959de Mon Sep 17 00:00:00 2001 From: peter Date: Sat, 20 Jun 1998 16:28:04 +0000 Subject: Merge ppp changes from 2.3.3 -> 2.3.5. I have spotted some more problems, which I'll have a go at shortly. --- sys/net/if_ppp.c | 11 +++-------- sys/net/ppp_comp.h | 5 ++--- sys/net/ppp_deflate.c | 19 ++++++++----------- sys/net/slcompress.h | 3 +-- sys/net/zlib.c | 6 +++--- 5 files changed, 17 insertions(+), 27 deletions(-) (limited to 'sys') diff --git a/sys/net/if_ppp.c b/sys/net/if_ppp.c index 8bbec24..6068f47 100644 --- a/sys/net/if_ppp.c +++ b/sys/net/if_ppp.c @@ -69,7 +69,7 @@ * Paul Mackerras (paulus@cs.anu.edu.au). */ -/* $Id: if_ppp.c,v 1.57 1998/05/19 14:04:09 dg Exp $ */ +/* $Id: if_ppp.c,v 1.58 1998/06/07 17:12:03 dfr Exp $ */ /* from if_sl.c,v 1.11 84/10/04 12:54:47 rick Exp */ /* from NetBSD: if_ppp.c,v 1.15.2.2 1994/07/28 05:17:58 cgd Exp */ @@ -183,10 +183,7 @@ static void pppdumpm __P((struct mbuf *m0)); */ extern struct compressor ppp_bsd_compress; -extern struct compressor ppp_deflate; -#ifdef CI_BADDEFLATE -extern struct compressor ppp_baddeflate; -#endif +extern struct compressor ppp_deflate, ppp_deflate_draft; static struct compressor *ppp_compressors[8] = { #if DO_BSD_COMPRESS && defined(PPP_BSDCOMP) @@ -194,9 +191,7 @@ static struct compressor *ppp_compressors[8] = { #endif #if DO_DEFLATE && defined(PPP_DEFLATE) &ppp_deflate, -#ifdef CI_BADDEFLATE - &ppp_baddeflate, -#endif + &ppp_deflate_draft, #endif NULL }; diff --git a/sys/net/ppp_comp.h b/sys/net/ppp_comp.h index 2b8fe6c..c187dee 100644 --- a/sys/net/ppp_comp.h +++ b/sys/net/ppp_comp.h @@ -24,7 +24,7 @@ * OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, * OR MODIFICATIONS. * - * $Id: ppp_comp.h,v 1.5 1997/08/19 14:10:46 peter Exp $ + * $Id: ppp_comp.h,v 1.6 1998/03/22 06:51:55 peter Exp $ */ #ifndef _NET_PPP_COMP_H @@ -142,8 +142,7 @@ struct compressor { * Definitions for Deflate. */ #define CI_DEFLATE 26 /* config option for Deflate */ -/* XXX ppp-2.3.x ships with CI_DEFLATE == 24, but that's Magnalink!! */ -#define CI_BADDEFLATE 24 /* config option for Magnalink */ +#define CI_DEFLATE_DRAFT 24 /* value used in original draft RFC */ #define CILEN_DEFLATE 4 /* length of its config option */ #define DEFLATE_MIN_SIZE 8 diff --git a/sys/net/ppp_deflate.c b/sys/net/ppp_deflate.c index ed2529c..bd7fd56 100644 --- a/sys/net/ppp_deflate.c +++ b/sys/net/ppp_deflate.c @@ -1,4 +1,4 @@ -/* $Id: ppp_deflate.c,v 1.8 1998/03/22 06:51:57 peter Exp $ */ +/* $Id: ppp_deflate.c,v 1.9 1998/03/25 14:28:28 peter Exp $ */ /* * ppp_deflate.c - interface the zlib procedures for Deflate compression @@ -97,9 +97,9 @@ struct compressor ppp_deflate = { z_incomp, /* incomp */ z_comp_stats, /* decomp_stat */ }; -#ifdef CI_BADDEFLATE -struct compressor ppp_baddeflate = { - CI_BADDEFLATE, /* compress_proto */ + +struct compressor ppp_deflate_draft = { + CI_DEFLATE_DRAFT, /* compress_proto */ z_comp_alloc, /* comp_alloc */ z_comp_free, /* comp_free */ z_comp_init, /* comp_init */ @@ -114,9 +114,6 @@ struct compressor ppp_baddeflate = { 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. @@ -152,7 +149,7 @@ z_comp_alloc(options, opt_len) int w_size; if (opt_len != CILEN_DEFLATE - || (options[0] != CI_DEFLATE && options[0] != CI_BADDEFLATE) + || (options[0] != CI_DEFLATE && options[0] != CI_DEFLATE_DRAFT) || options[1] != CILEN_DEFLATE || DEFLATE_METHOD(options[2]) != DEFLATE_METHOD_VAL || options[3] != DEFLATE_CHK_SEQUENCE) @@ -199,7 +196,7 @@ 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 && options[0] != CI_BADDEFLATE) + || (options[0] != CI_DEFLATE && options[0] != CI_DEFLATE_DRAFT) || options[1] != CILEN_DEFLATE || DEFLATE_METHOD(options[2]) != DEFLATE_METHOD_VAL || DEFLATE_SIZE(options[2]) != state->w_size @@ -385,7 +382,7 @@ z_decomp_alloc(options, opt_len) int w_size; if (opt_len != CILEN_DEFLATE - || (options[0] != CI_DEFLATE && options[0] != CI_BADDEFLATE) + || (options[0] != CI_DEFLATE && options[0] != CI_DEFLATE_DRAFT) || options[1] != CILEN_DEFLATE || DEFLATE_METHOD(options[2]) != DEFLATE_METHOD_VAL || options[3] != DEFLATE_CHK_SEQUENCE) @@ -431,7 +428,7 @@ 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 && options[0] != CI_BADDEFLATE) + || (options[0] != CI_DEFLATE && options[0] != CI_DEFLATE_DRAFT) || options[1] != CILEN_DEFLATE || DEFLATE_METHOD(options[2]) != DEFLATE_METHOD_VAL || DEFLATE_SIZE(options[2]) != state->w_size diff --git a/sys/net/slcompress.h b/sys/net/slcompress.h index aa7f10b..5c273ab 100644 --- a/sys/net/slcompress.h +++ b/sys/net/slcompress.h @@ -1,4 +1,3 @@ -/* slcompress.h 8.1 93/06/10 */ /* * Definitions for tcp compression routines. * @@ -35,7 +34,7 @@ * * Van Jacobson (van@helios.ee.lbl.gov), Dec 31, 1989: * - Initial distribution. - * $Id: slcompress.h,v 1.11 1997/02/22 09:41:16 peter Exp $ + * $Id: slcompress.h,v 1.12 1997/08/19 14:10:48 peter Exp $ */ #ifndef _NET_SLCOMPRESS_H_ diff --git a/sys/net/zlib.c b/sys/net/zlib.c index 1016253..f16092d 100644 --- a/sys/net/zlib.c +++ b/sys/net/zlib.c @@ -10,7 +10,7 @@ * - added inflateIncomp and deflateOutputPending * - allow strm->next_out to be NULL, meaning discard the output * - * $Id: zlib.c,v 1.5 1998/02/09 06:10:02 eivind Exp $ + * $Id: zlib.c,v 1.6 1998/03/21 20:56:15 peter Exp $ */ /* @@ -1151,12 +1151,12 @@ int deflateCopy (dest, source) return Z_STREAM_ERROR; ss = (deflate_state *) source->state; - *dest = *source; + zmemcpy(dest, source, sizeof(*dest)); ds = (deflate_state *) ZALLOC(dest, 1, sizeof(deflate_state)); if (ds == Z_NULL) return Z_MEM_ERROR; dest->state = (struct internal_state FAR *) ds; - *ds = *ss; + zmemcpy(ds, ss, sizeof(*ds)); ds->strm = dest; ds->window = (Bytef *) ZALLOC(dest, ds->w_size, 2*sizeof(Byte)); -- cgit v1.1