summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbrian <brian@openbsd.org>1999-01-13 17:39:57 +0000
committerbrian <brian@openbsd.org>1999-01-13 17:39:57 +0000
commitaf1f7162b9533e12a05cf49d17bbf8ad0d447df7 (patch)
treeb0bcfd1828c953dfc5473a690f0665778ee92e8c
parentbuild dyncall (diff)
downloadwireguard-openbsd-af1f7162b9533e12a05cf49d17bbf8ad0d447df7.tar.xz
wireguard-openbsd-af1f7162b9533e12a05cf49d17bbf8ad0d447df7.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>
-rw-r--r--usr.sbin/ppp/ppp/datalink.c14
-rw-r--r--usr.sbin/ppp/ppp/lcp.c4
2 files changed, 11 insertions, 7 deletions
diff --git a/usr.sbin/ppp/ppp/datalink.c b/usr.sbin/ppp/ppp/datalink.c
index 17be3a4f855..934f406b8fb 100644
--- a/usr.sbin/ppp/ppp/datalink.c
+++ b/usr.sbin/ppp/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.5 1999/01/08 17:26:45 brian Exp $
+ * $Id: datalink.c,v 1.6 1999/01/13 17:39:57 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/ppp/lcp.c b/usr.sbin/ppp/ppp/lcp.c
index a551caa60b0..5b8fe164aed 100644
--- a/usr.sbin/ppp/ppp/lcp.c
+++ b/usr.sbin/ppp/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.4 1998/10/29 02:21:45 brian Exp $
+ * $Id: lcp.c,v 1.5 1999/01/13 17:39:57 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))