summaryrefslogtreecommitdiff
path: root/sys/src/cmd
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2016-03-15 22:18:05 +0100
committercinap_lenrek <cinap_lenrek@felloff.net>2016-03-15 22:18:05 +0100
commitbd0f48b3579968c011e17a4c6acce3826e4395f6 (patch)
treefe6b0b2efb693d13de6b04c147d0574c099c3b53 /sys/src/cmd
parent74d4d8a26e876e54f5070d993478adde86cef34f (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/src/cmd')
-rw-r--r--sys/src/cmd/ip/ppp/ppp.c28
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 */