X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;ds=sidebyside;f=pppd%2Fccp.c;h=2941de5f7a5c79b72a603153866442850bcfdedb;hb=10844eebcc23bf66dc5ddd1a00364b22eb970fd6;hp=3e408ba27f6e4339174dccad4e2f23f012eca99a;hpb=28b9d996e0487c5b0ae71aaa40b4db76f7b1fa1e;p=ppp.git diff --git a/pppd/ccp.c b/pppd/ccp.c index 3e408ba..2941de5 100644 --- a/pppd/ccp.c +++ b/pppd/ccp.c @@ -25,7 +25,7 @@ * OR MODIFICATIONS. */ -#define RCSID "$Id: ccp.c,v 1.36 2002/05/28 17:00:57 dfs Exp $" +#define RCSID "$Id: ccp.c,v 1.38 2002/07/10 20:04:35 kad Exp $" #include #include @@ -37,7 +37,7 @@ #ifdef MPPE #include "chap_ms.h" /* mppe_xxxx_key */ -#include "lcp.h" /* lcp_close() */ +#include "lcp.h" /* lcp_close(), lcp_fsm */ #endif static const char rcsid[] = RCSID; @@ -512,9 +512,10 @@ ccp_protrej(unit) fsm_lowerdown(&ccp_fsm[unit]); #ifdef MPPE - if (ccp_gotoptions[unit].mppe) + if (ccp_gotoptions[unit].mppe) { error("MPPE required but peer negotiation failed"); lcp_close(unit, "MPPE required but peer negotiation failed"); + } #endif } @@ -1438,8 +1439,12 @@ ccp_down(f) ccp_flags_set(f->unit, 1, 0); #ifdef MPPE if (ccp_gotoptions[f->unit].mppe) { - error("MPPE disabled"); - lcp_close(f->unit, "MPPE disabled"); + ccp_gotoptions[f->unit].mppe = 0; + if (lcp_fsm[f->unit].state == OPENED) { + /* If LCP is not already going down, make sure it does. */ + error("MPPE disabled"); + lcp_close(f->unit, "MPPE disabled"); + } } #endif }