diff options
author | Brian Somers <brian@FreeBSD.org> | 1999-01-12 21:50:20 +0000 |
---|---|---|
committer | Brian Somers <brian@FreeBSD.org> | 1999-01-12 21:50:20 +0000 |
commit | 5165af6fa8f1c350aaefb7e29cb558bc3cd84875 (patch) | |
tree | ec35aa2ddb7e4e9bf2d0f6c7851dc19b4d5df574 | |
parent | 9857e58226db2d1578be5e198d18e33e05bb0bfd (diff) | |
download | src-5165af6fa8f1c350aaefb7e29cb558bc3cd84875.tar.gz src-5165af6fa8f1c350aaefb7e29cb558bc3cd84875.zip |
If we've configured CBCP *and* another not-so-important
CALLBACK protocol and end up agreeing CBCP, DTRT and go
into CBCP phase rather than mistakenly terminating as
if CBCP wasn't agreed.
Problem reported by: Alexander Dubinin <alex@nstl.nnov.ru>
Notes
Notes:
svn path=/head/; revision=42600
-rw-r--r-- | usr.sbin/ppp/datalink.c | 14 | ||||
-rw-r--r-- | usr.sbin/ppp/lcp.c | 4 |
2 files changed, 11 insertions, 7 deletions
diff --git a/usr.sbin/ppp/datalink.c b/usr.sbin/ppp/datalink.c index 97ddd0c18b9b..2f04f27df190 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.22 1998/12/15 19:12:24 brian Exp $ + * $Id: datalink.c,v 1.23 1999/01/08 09:04:58 brian Exp $ */ #include <sys/types.h> @@ -553,13 +553,17 @@ datalink_CBCPFailed(struct datalink *dl) void datalink_AuthOk(struct datalink *dl) { - if (dl->physical->link.lcp.his_callback.opmask == - CALLBACK_BIT(CALLBACK_CBCP) || - dl->physical->link.lcp.want_callback.opmask == - CALLBACK_BIT(CALLBACK_CBCP)) { + if ((dl->physical->link.lcp.his_callback.opmask & + CALLBACK_BIT(CALLBACK_CBCP) || + dl->physical->link.lcp.want_callback.opmask & + CALLBACK_BIT(CALLBACK_CBCP)) && + !(dl->physical->link.lcp.want_callback.opmask & + CALLBACK_BIT(CALLBACK_AUTH))) { + /* We must have agreed CBCP if AUTH isn't there any more */ datalink_NewState(dl, DATALINK_CBCP); cbcp_Up(&dl->cbcp); } else if (dl->physical->link.lcp.want_callback.opmask) { + /* It's not CBCP */ log_Printf(LogPHASE, "%s: Shutdown and await peer callback\n", dl->name); datalink_NewState(dl, DATALINK_LCP); fsm_Close(&dl->physical->link.lcp.fsm); diff --git a/usr.sbin/ppp/lcp.c b/usr.sbin/ppp/lcp.c index 462b81fb8517..10165fd1d24b 100644 --- a/usr.sbin/ppp/lcp.c +++ b/usr.sbin/ppp/lcp.c @@ -17,7 +17,7 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $Id: lcp.c,v 1.64 1998/09/09 00:03:09 brian Exp $ + * $Id: lcp.c,v 1.65 1998/10/17 12:28:02 brian Exp $ * * TODO: * o Limit data field length by MRU @@ -921,7 +921,7 @@ LcpDecodeConfig(struct fsm *fp, u_char *cp, int plen, int mode_type, goto reqreject; break; case MODE_NAK: - /* We don't do what he NAKs want, we do things in our preferred order */ + /* We don't do what he NAKs with, we do things in our preferred order */ if (lcp->want_callback.opmask & CALLBACK_BIT(CALLBACK_AUTH)) lcp->want_callback.opmask &= ~CALLBACK_BIT(CALLBACK_AUTH); else if (lcp->want_callback.opmask & CALLBACK_BIT(CALLBACK_CBCP)) |