Remove initial startup printf's in -direct mode.

Make "same magic" error send a NAK (as per rfc).
This commit is contained in:
brian 1997-06-01 03:43:26 +00:00
parent b583e76068
commit a58096cbf5
4 changed files with 25 additions and 16 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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);