summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>1998-05-23 13:38:09 +0000
committerbrian <brian@FreeBSD.org>1998-05-23 13:38:09 +0000
commit35a7434e269cd17a2450cb27e969145819c4689e (patch)
treec894c5aa24d59ceecf48cedb95f4e783ce515281 /usr.sbin
parentb76b64615436a954f7dc5ea3ddcc922b2d8d2301 (diff)
downloadFreeBSD-src-35a7434e269cd17a2450cb27e969145819c4689e.zip
FreeBSD-src-35a7434e269cd17a2450cb27e969145819c4689e.tar.gz
o If all CCPs are disabled & denied, don't send a REQ - just enter
STOPPED state waiting for the peer to say something.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/ppp/ccp.c14
-rw-r--r--usr.sbin/ppp/ccp.h3
-rw-r--r--usr.sbin/ppp/datalink.c6
-rw-r--r--usr.sbin/ppp/mp.c3
4 files changed, 21 insertions, 5 deletions
diff --git a/usr.sbin/ppp/ccp.c b/usr.sbin/ppp/ccp.c
index 12ace1a..3a52abc 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.30.2.45 1998/05/21 01:26:05 brian Exp $
+ * $Id: ccp.c,v 1.32 1998/05/21 21:44:21 brian Exp $
*
* TODO:
* o Support other compression protocols
@@ -588,3 +588,15 @@ ccp_Proto(struct ccp *ccp)
return !link2physical(ccp->fsm.link) || !ccp->fsm.bundle->ncp.mp.active ?
PROTO_COMPD : PROTO_ICOMPD;
}
+
+void
+ccp_SetOpenMode(struct ccp *ccp)
+{
+ int f;
+
+ for (f = 0; f < CCP_NEG_TOTAL; f++)
+ if (ccp->cfg.neg[f])
+ ccp->fsm.open_mode = 0;
+
+ ccp->fsm.open_mode = OPEN_PASSIVE; /* Go straight to ST_STOPPED */
+}
diff --git a/usr.sbin/ppp/ccp.h b/usr.sbin/ppp/ccp.h
index 4652fd9..8b1787b 100644
--- a/usr.sbin/ppp/ccp.h
+++ b/usr.sbin/ppp/ccp.h
@@ -15,7 +15,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: ccp.h,v 1.14.2.20 1998/05/01 19:24:00 brian Exp $
+ * $Id: ccp.h,v 1.15 1998/05/21 21:44:23 brian Exp $
*
* TODO:
*/
@@ -125,3 +125,4 @@ extern int ccp_Compress(struct ccp *, struct link *, int, u_short, struct mbuf *
extern struct mbuf *ccp_Decompress(struct ccp *, u_short *, struct mbuf *);
extern u_short ccp_Proto(struct ccp *);
extern void ccp_SetupCallbacks(struct ccp *);
+extern void ccp_SetOpenMode(struct ccp *);
diff --git a/usr.sbin/ppp/datalink.c b/usr.sbin/ppp/datalink.c
index 0965f0a..4d4c20e 100644
--- a/usr.sbin/ppp/datalink.c
+++ b/usr.sbin/ppp/datalink.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: datalink.c,v 1.1.2.63 1998/05/16 23:47:24 brian Exp $
+ * $Id: datalink.c,v 1.2 1998/05/21 21:44:54 brian Exp $
*/
#include <sys/types.h>
@@ -452,6 +452,8 @@ datalink_GotAuthname(struct datalink *dl, const char *name, int len)
void
datalink_AuthOk(struct datalink *dl)
{
+ ccp_SetOpenMode(&dl->physical->link.ccp);
+
if (dl->physical->link.lcp.want_mrru && dl->physical->link.lcp.his_mrru) {
/* we've authenticated in multilink mode ! */
switch (mp_Up(&dl->bundle->ncp.mp, dl)) {
@@ -464,7 +466,7 @@ datalink_AuthOk(struct datalink *dl)
/* fall through */
case MP_ADDED:
/* We're in multilink mode ! */
- dl->physical->link.ccp.fsm.open_mode = OPEN_PASSIVE;
+ dl->physical->link.ccp.fsm.open_mode = OPEN_PASSIVE; /* override */
break;
case MP_FAILED:
datalink_AuthNotOk(dl);
diff --git a/usr.sbin/ppp/mp.c b/usr.sbin/ppp/mp.c
index d022b1b..1ed6846 100644
--- a/usr.sbin/ppp/mp.c
+++ b/usr.sbin/ppp/mp.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: mp.c,v 1.1.2.29 1998/05/15 18:21:41 brian Exp $
+ * $Id: mp.c,v 1.2 1998/05/21 21:47:05 brian Exp $
*/
#include <sys/types.h>
@@ -272,6 +272,7 @@ mp_Up(struct mp *mp, struct datalink *dl)
ipcp_SetLink(&mp->bundle->ncp.ipcp, &mp->link);
/* Our lcp's already up 'cos of the NULL parent */
+ ccp_SetOpenMode(&mp->link.ccp);
fsm_Up(&mp->link.ccp.fsm);
fsm_Open(&mp->link.ccp.fsm);
OpenPOWER on IntegriCloud