diff options
author | brian <brian@FreeBSD.org> | 1997-06-01 03:43:26 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 1997-06-01 03:43:26 +0000 |
commit | e39002afc27c9ffda52400838c668a0af8e9982c (patch) | |
tree | ef1d02091667d6794da32fccb39ee68afa6d5265 | |
parent | 0e779533082753004e1e3529858c07205320d59e (diff) | |
download | FreeBSD-src-e39002afc27c9ffda52400838c668a0af8e9982c.zip FreeBSD-src-e39002afc27c9ffda52400838c668a0af8e9982c.tar.gz |
Remove initial startup printf's in -direct mode.
Make "same magic" error send a NAK (as per rfc).
-rw-r--r-- | usr.sbin/ppp/lcp.c | 18 | ||||
-rw-r--r-- | usr.sbin/ppp/log.c | 5 | ||||
-rw-r--r-- | usr.sbin/ppp/main.c | 13 | ||||
-rw-r--r-- | usr.sbin/ppp/os.c | 5 |
4 files changed, 25 insertions, 16 deletions
diff --git a/usr.sbin/ppp/lcp.c b/usr.sbin/ppp/lcp.c index 2a63d00..8134329 100644 --- a/usr.sbin/ppp/lcp.c +++ b/usr.sbin/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.20 1997/05/24 17:32:38 brian Exp $ + * $Id: lcp.c,v 1.21 1997/05/26 00:44:03 brian Exp $ * * TODO: * o Validate magic number received from peer. @@ -574,12 +574,16 @@ int mode; switch (mode) { case MODE_REQ: if (LcpInfo.want_magic) { - /* XXX: Shoud validate magic number */ - if (magic == LcpInfo.want_magic) - logprintf("magic is same!! %x, %x, %x\n", - magic, LcpInfo.want_magic, LcpInfo.his_magic); - LcpInfo.his_magic = magic; - bcopy(cp, ackp, length); ackp += length; + /* Validate magic number */ + if (magic == LcpInfo.want_magic) { + LogPrintf(LOG_LCP_BIT, "Magic is same (%08x)\n", magic); + LcpInfo.want_magic = GenerateMagic(); + bcopy(cp, nakp, 6); + nakp += 6; + } else { + LcpInfo.his_magic = magic; + bcopy(cp, ackp, length); ackp += length; + } } else { LcpInfo.my_reject |= (1 << type); goto reqreject; diff --git a/usr.sbin/ppp/log.c b/usr.sbin/ppp/log.c index 0592131..7cd4332 100644 --- a/usr.sbin/ppp/log.c +++ b/usr.sbin/ppp/log.c @@ -17,7 +17,7 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $Id: log.c,v 1.10 1997/05/07 23:30:48 brian Exp $ + * $Id: log.c,v 1.11 1997/05/26 00:44:05 brian Exp $ * */ #include "defs.h" @@ -75,7 +75,8 @@ int tunno; return(1); } #endif - fprintf(stderr, "Log level is %02x\r\n", loglevel); + if (!(mode & MODE_DIRECT)) + fprintf(stderr, "Log level is %02x\r\n", loglevel); logptr = logbuff; logcnt = 0; logtop = lognext = NULL; diff --git a/usr.sbin/ppp/main.c b/usr.sbin/ppp/main.c index 5cf2f4a..ec01a47 100644 --- a/usr.sbin/ppp/main.c +++ b/usr.sbin/ppp/main.c @@ -17,7 +17,7 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $Id: main.c,v 1.57 1997/05/26 00:44:06 brian Exp $ + * $Id: main.c,v 1.58 1997/05/29 02:29:12 brian Exp $ * * TODO: * o Add commands for traffic summary, version display, etc. @@ -330,7 +330,8 @@ char **argv; mode = MODE_INTER; /* default operation is interactive mode */ netfd = server = modem = tun_in = -1; ProcessArgs(argc, argv); - Greetings(); + if (!(mode & MODE_DIRECT)) + Greetings(); GetUid(); IpcpDefAddress(); @@ -340,9 +341,11 @@ char **argv; switch ( LocalAuthInit() ) { case NOT_FOUND: - fprintf(stderr,LAUTH_M1); - fprintf(stderr,LAUTH_M2); - fflush (stderr); + if (!(mode & MODE_DIRECT)) { + fprintf(stderr,LAUTH_M1); + fprintf(stderr,LAUTH_M2); + fflush (stderr); + } /* Fall down */ case VALID: VarLocalAuth = LOCAL_AUTH; diff --git a/usr.sbin/ppp/os.c b/usr.sbin/ppp/os.c index c5072b2..d2a161a 100644 --- a/usr.sbin/ppp/os.c +++ b/usr.sbin/ppp/os.c @@ -17,7 +17,7 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $Id: os.c,v 1.19 1997/05/26 00:44:08 brian Exp $ + * $Id: os.c,v 1.20 1997/06/01 01:13:03 brian Exp $ * */ #include "fsm.h" @@ -352,7 +352,8 @@ int *ptun; close(s); return(-1); } - printf("Using interface: %s\r\n", IfDevName); + if (!(mode & MODE_DIRECT)) + printf("Using interface: %s\r\n", IfDevName); LogPrintf(LOG_PHASE_BIT, "Using interface: %s\n", IfDevName); close(s); return(0); |