mppc - Finish pluging NETGRAPH_MPPC_COMPRESSION.

There were several places where reference to compression were left
unfinished. Furthermore, KASSERTs contained references to MPPC_INVALID
which is not defined in the tree and therefore were sure to break with
INVARIANTS: comment them out.

Reported by:	Eugene Grosbein
PR:		216265
MFC after:	3 days
This commit is contained in:
pfg 2017-01-20 00:02:11 +00:00
parent bad55a0870
commit c33a77a05d
3 changed files with 4 additions and 7 deletions

View File

@ -774,8 +774,7 @@ options NETGRAPH_IPFW
options NETGRAPH_KSOCKET options NETGRAPH_KSOCKET
options NETGRAPH_L2TP options NETGRAPH_L2TP
options NETGRAPH_LMI options NETGRAPH_LMI
# MPPC compression requires proprietary files (not included) options NETGRAPH_MPPC_COMPRESSION
#options NETGRAPH_MPPC_COMPRESSION
options NETGRAPH_MPPC_ENCRYPTION options NETGRAPH_MPPC_ENCRYPTION
options NETGRAPH_NETFLOW options NETGRAPH_NETFLOW
options NETGRAPH_NAT options NETGRAPH_NAT

View File

@ -517,7 +517,6 @@ NETGRAPH_IPFW opt_netgraph.h
NETGRAPH_KSOCKET opt_netgraph.h NETGRAPH_KSOCKET opt_netgraph.h
NETGRAPH_L2TP opt_netgraph.h NETGRAPH_L2TP opt_netgraph.h
NETGRAPH_LMI opt_netgraph.h NETGRAPH_LMI opt_netgraph.h
# MPPC compression requires proprietary files (not included)
NETGRAPH_MPPC_COMPRESSION opt_netgraph.h NETGRAPH_MPPC_COMPRESSION opt_netgraph.h
NETGRAPH_MPPC_ENCRYPTION opt_netgraph.h NETGRAPH_MPPC_ENCRYPTION opt_netgraph.h
NETGRAPH_NAT opt_netgraph.h NETGRAPH_NAT opt_netgraph.h

View File

@ -66,7 +66,7 @@
#if !defined(NETGRAPH_MPPC_COMPRESSION) && !defined(NETGRAPH_MPPC_ENCRYPTION) #if !defined(NETGRAPH_MPPC_COMPRESSION) && !defined(NETGRAPH_MPPC_ENCRYPTION)
#ifdef KLD_MODULE #ifdef KLD_MODULE
/* XXX NETGRAPH_MPPC_COMPRESSION isn't functional yet */ #define NETGRAPH_MPPC_COMPRESSION
#define NETGRAPH_MPPC_ENCRYPTION #define NETGRAPH_MPPC_ENCRYPTION
#else #else
/* This case is indicative of an error in sys/conf files */ /* This case is indicative of an error in sys/conf files */
@ -81,7 +81,6 @@ static MALLOC_DEFINE(M_NETGRAPH_MPPC, "netgraph_mppc", "netgraph mppc node");
#endif #endif
#ifdef NETGRAPH_MPPC_COMPRESSION #ifdef NETGRAPH_MPPC_COMPRESSION
/* XXX this file doesn't exist yet, but hopefully someday it will... */
#include <net/mppc.h> #include <net/mppc.h>
#endif #endif
#ifdef NETGRAPH_MPPC_ENCRYPTION #ifdef NETGRAPH_MPPC_ENCRYPTION
@ -543,7 +542,7 @@ ng_mppc_compress(node_p node, struct mbuf **datap)
&destCnt, d->history, flags, 0); &destCnt, d->history, flags, 0);
/* Check return value */ /* Check return value */
KASSERT(rtn != MPPC_INVALID, ("%s: invalid", __func__)); /* KASSERT(rtn != MPPC_INVALID, ("%s: invalid", __func__)); */
if ((rtn & MPPC_EXPANDED) == 0 if ((rtn & MPPC_EXPANDED) == 0
&& (rtn & MPPC_COMP_OK) == MPPC_COMP_OK) { && (rtn & MPPC_COMP_OK) == MPPC_COMP_OK) {
outlen -= destCnt; outlen -= destCnt;
@ -805,7 +804,7 @@ ng_mppc_decompress(node_p node, struct mbuf **datap)
&sourceCnt, &destCnt, d->history, flags); &sourceCnt, &destCnt, d->history, flags);
/* Check return value */ /* Check return value */
KASSERT(rtn != MPPC_INVALID, ("%s: invalid", __func__)); /* KASSERT(rtn != MPPC_INVALID, ("%s: invalid", __func__)); */
if ((rtn & MPPC_DEST_EXHAUSTED) != 0 if ((rtn & MPPC_DEST_EXHAUSTED) != 0
|| (rtn & MPPC_DECOMP_OK) != MPPC_DECOMP_OK) { || (rtn & MPPC_DECOMP_OK) != MPPC_DECOMP_OK) {
log(LOG_ERR, "%s: decomp returned 0x%x", log(LOG_ERR, "%s: decomp returned 0x%x",