diff options
author | brian <brian@FreeBSD.org> | 1997-12-07 23:55:29 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 1997-12-07 23:55:29 +0000 |
commit | 7f92055123c4be565e54b2e37be01cfdcdc56b97 (patch) | |
tree | 27dcd67f873556bbcd0ecb1716a06964c949a31d /usr.sbin/ppp/phase.c | |
parent | df69c965c11136365acfe29358924b3657349be3 (diff) | |
download | FreeBSD-src-7f92055123c4be565e54b2e37be01cfdcdc56b97.zip FreeBSD-src-7f92055123c4be565e54b2e37be01cfdcdc56b97.tar.gz |
Fix PAP, CHAP & LQR req (I broke the byte ordering when
I did the deflate re-org).
Make PAP & CHAP negotiation prettier in the log file.
If both PAP & CHAP are `enabled' and the peer NAKs CHAP
suggesting PAP, be friendly and REQ PAP the next time.
This is in line with the rfc.
Diffstat (limited to 'usr.sbin/ppp/phase.c')
-rw-r--r-- | usr.sbin/ppp/phase.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/usr.sbin/ppp/phase.c b/usr.sbin/ppp/phase.c index 63695f7..4b6d175 100644 --- a/usr.sbin/ppp/phase.c +++ b/usr.sbin/ppp/phase.c @@ -1,5 +1,5 @@ /* - * $Id: phase.c,v 1.2 1997/10/29 01:19:50 brian Exp $ + * $Id: phase.c,v 1.3 1997/11/22 03:37:43 brian Exp $ */ #include <sys/param.h> @@ -30,6 +30,20 @@ static const char *PhaseNames[] = { "Dead", "Establish", "Authenticate", "Network", "Terminate" }; +static const char * +Auth2Nam(u_short auth) +{ + switch (auth) { + case PROTO_PAP: + return "PAP"; + case PROTO_CHAP: + return "CHAP"; + case 0: + return "none"; + } + return "unknown"; +} + void NewPhase(int new) { @@ -42,7 +56,8 @@ NewPhase(int new) lcp->auth_ineed = lcp->want_auth; lcp->auth_iwait = lcp->his_auth; if (lcp->his_auth || lcp->want_auth) { - LogPrintf(LogPHASE, " his = %x, mine = %x\n", lcp->his_auth, lcp->want_auth); + LogPrintf(LogPHASE, " his = %s, mine = %s\n", + Auth2Nam(lcp->his_auth), Auth2Nam(lcp->want_auth)); if (lcp->his_auth == PROTO_PAP) StartAuthChallenge(&AuthPapInfo); if (lcp->want_auth == PROTO_CHAP) |