summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/ccp.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>1998-06-30 23:04:17 +0000
committerbrian <brian@FreeBSD.org>1998-06-30 23:04:17 +0000
commit079249c72b5c0fb2904b7a7047d32db6093792ee (patch)
tree42c0587c812526ccf54e9882ce1fc39a80e2f980 /usr.sbin/ppp/ccp.c
parent805c8719671543e774a7eb330ccd6b2d829a535a (diff)
downloadFreeBSD-src-079249c72b5c0fb2904b7a7047d32db6093792ee.zip
FreeBSD-src-079249c72b5c0fb2904b7a7047d32db6093792ee.tar.gz
The CCP layer now behaves as follows:
o If we've denied and disabled all compression protocols, stay in ST_INITIAL and do an LCP protocol reject if we receive any CCP packets. o If we've disabled all compression protocols, go to ST_STOPPED and wait for the other side to ask for something. o If we've got anything enabled, start REQing as soon as the auth layer is up. o If we're in multilink mode, than the link level CCP goes straight to ST_STOPPED irrespective of what's configured so that we never try to compress compressed stuff by default.
Diffstat (limited to 'usr.sbin/ppp/ccp.c')
-rw-r--r--usr.sbin/ppp/ccp.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/usr.sbin/ppp/ccp.c b/usr.sbin/ppp/ccp.c
index 62f4059..9141d77 100644
--- a/usr.sbin/ppp/ccp.c
+++ b/usr.sbin/ppp/ccp.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: ccp.c,v 1.35 1998/06/25 22:33:12 brian Exp $
+ * $Id: ccp.c,v 1.36 1998/06/27 23:48:40 brian Exp $
*
* TODO:
* o Support other compression protocols
@@ -590,14 +590,22 @@ ccp_Proto(struct ccp *ccp)
PROTO_COMPD : PROTO_ICOMPD;
}
-void
+int
ccp_SetOpenMode(struct ccp *ccp)
{
int f;
for (f = 0; f < CCP_NEG_TOTAL; f++)
- if (ccp->cfg.neg[f])
+ if (IsEnabled(ccp->cfg.neg[f])) {
ccp->fsm.open_mode = 0;
+ return 1;
+ }
+
+ ccp->fsm.open_mode = OPEN_PASSIVE; /* Go straight to ST_STOPPED ? */
+
+ for (f = 0; f < CCP_NEG_TOTAL; f++)
+ if (IsAccepted(ccp->cfg.neg[f]))
+ return 1;
- ccp->fsm.open_mode = OPEN_PASSIVE; /* Go straight to ST_STOPPED */
+ return 0; /* No CCP at all */
}
OpenPOWER on IntegriCloud