diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2016-03-15 22:18:05 +0100 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2016-03-15 22:18:05 +0100 |
commit | bd0f48b3579968c011e17a4c6acce3826e4395f6 (patch) | |
tree | fe6b0b2efb693d13de6b04c147d0574c099c3b53 /sys | |
parent | 74d4d8a26e876e54f5070d993478adde86cef34f (diff) |
ppp: md5 and mschap inside chap, do not request encryption with -c or -C (thanks k0ga)
p2.patch: Do not request encriptation with -c or -C in ppp
(it was a bit annoying request compression, and when the ACK
from the server was received then send a NAK).
p3.patch: Add support for md5 and mschap in in chap
(without this patch ppp was passing to the net stage
without worring about chap).
Diffstat (limited to 'sys')
-rw-r--r-- | sys/src/cmd/ip/ppp/ppp.c | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/sys/src/cmd/ip/ppp/ppp.c b/sys/src/cmd/ip/ppp/ppp.c index 4f9ce3cf8..9ebfff1aa 100644 --- a/sys/src/cmd/ip/ppp/ppp.c +++ b/sys/src/cmd/ip/ppp/ppp.c @@ -243,12 +243,21 @@ setphase(PPP *ppp, int phase) } break; case Pauth: - if(server) + if(server) { chapinit(ppp); - else if(ppp->chap->proto == APpasswd) - papinit(ppp); - else - setphase(ppp, Pnet); + } else { + switch (ppp->chap->proto) { + case APpasswd: + papinit(ppp); + break; + case APmd5: + case APmschap: + break; + default: + setphase(ppp, Pnet); + break; + } + } break; case Pnet: pinit(ppp, ppp->ccp); @@ -276,7 +285,14 @@ pinit(PPP *ppp, Pstate *p) ppp->rctlmap = 0; ppp->ipcp->state = Sclosed; ppp->ipcp->optmask = 0xffffffff; - + if(noipcompress) { + p->optmask &= ~Fac; + ppp->ipcp->optmask &= ~Fipaddrs; + } + if(nocompress) { + p->optmask &= ~Fpc; + ppp->ipcp->optmask &= ~Fipcompress; + } p->echotimeout = 0; /* quality goo */ |