summaryrefslogtreecommitdiff
path: root/sys/src/cmd
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@gmx.de>2012-08-07 15:57:42 +0200
committercinap_lenrek <cinap_lenrek@gmx.de>2012-08-07 15:57:42 +0200
commit37a93ef857ad49bee2059a5a52f50190b7bf040f (patch)
tree314e39f97cf50bca73d90871a903415ae5ab6d6f /sys/src/cmd
parent36adf27af89970ce73e77d798794479c077678f2 (diff)
ppp: noauth server option (import from sources)
Diffstat (limited to 'sys/src/cmd')
-rw-r--r--sys/src/cmd/ip/ppp/ppp.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/src/cmd/ip/ppp/ppp.c b/sys/src/cmd/ip/ppp/ppp.c
index da27dec26..29962a1b3 100644
--- a/sys/src/cmd/ip/ppp/ppp.c
+++ b/sys/src/cmd/ip/ppp/ppp.c
@@ -17,6 +17,7 @@ static int nocompress;
static int pppframing = 1;
static int noipcompress;
static int server;
+static int noauth;
static int nip; /* number of ip interfaces */
static int dying; /* flag to signal to all threads its time to go */
static int primary; /* this is the primary IP interface */
@@ -332,7 +333,7 @@ newstate(PPP *ppp, Pstate *p, int state)
if(p->proto == Plcp) {
if(state == Sopened)
- setphase(ppp, Pauth);
+ setphase(ppp, noauth? Pnet : Pauth);
else if(state == Sclosed)
setphase(ppp, Pdead);
else if(p->state == Sopened)
@@ -355,7 +356,7 @@ newstate(PPP *ppp, Pstate *p, int state)
}
if(p->proto == Pipcp && state == Sopened) {
- if(server && ppp->chap->state != Cauthok)
+ if(server && !noauth && ppp->chap->state != Cauthok)
abort();
err = ipopen(ppp);
@@ -2658,7 +2659,9 @@ int interactive;
void
usage(void)
{
- fprint(2, "usage: ppp [-cCdfPSu] [-b baud] [-k keyspec] [-m mtu] [-p dev] [-s username] [-x netmntpt] [-t modemcmd] [local-addr [remote-addr]]\n");
+ fprint(2, "usage: ppp [-CPSacdfu] [-b baud] [-k keyspec] [-m mtu] "
+ "[-M chatfile] [-p dev] [-x netmntpt] [-t modemcmd] "
+ "[local-addr [remote-addr]]\n");
exits("usage");
}
@@ -2691,6 +2694,9 @@ main(int argc, char **argv)
modemcmd = nil;
ARGBEGIN{
+ case 'a':
+ noauth = 1;
+ break;
case 'b':
baud = atoi(EARGF(usage()));
if(baud < 0)