diff options
author | brian <brian@FreeBSD.org> | 1997-12-27 13:45:57 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 1997-12-27 13:45:57 +0000 |
commit | ddf3da84955259f875ffc03f9b8945fb9e36d3a5 (patch) | |
tree | 29676590de1cf3ab7926a067f5898dde1345e653 /usr.sbin/ppp/main.c | |
parent | d03808004927d9310c50fb5885b4908a0d39c340 (diff) | |
download | FreeBSD-src-ddf3da84955259f875ffc03f9b8945fb9e36d3a5.zip FreeBSD-src-ddf3da84955259f875ffc03f9b8945fb9e36d3a5.tar.gz |
Show who closes the diagnostic connection.
Show the IP range (if specified) in "show ipcp".
Close unused descriptors 0 and 2 in interactive mode.
Pass (size_t *) rather than (int *) to sysctl().
Diffstat (limited to 'usr.sbin/ppp/main.c')
-rw-r--r-- | usr.sbin/ppp/main.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/usr.sbin/ppp/main.c b/usr.sbin/ppp/main.c index 7aa9dca..67e7c7e 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.110 1997/12/22 02:28:18 brian Exp $ + * $Id: main.c,v 1.111 1997/12/24 09:29:06 brian Exp $ * * TODO: * o Add commands for traffic summary, version display, etc. @@ -183,7 +183,7 @@ TtyOldMode() void Cleanup(int excode) { - DropClient(); + DropClient(1); ServerClose(); OsInterfaceDown(1); HangupModem(1); @@ -535,12 +535,15 @@ main(int argc, char **argv) close(2); if (mode & MODE_DIRECT) + /* fd 0 gets used by OpenModem in DIRECT mode */ TtyInit(1); else if (mode & MODE_DAEMON) { setsid(); close(0); } } else { + close(0); + close(2); TtyInit(0); TtyCommandMode(1); } @@ -626,8 +629,10 @@ ReadTty(void) if (n) DecodeCommand(linebuff, n, IsInteractive(0) ? NULL : "Client"); Prompt(); - } else if (n <= 0) - DropClient(); + } else if (n <= 0) { + LogPrintf(LogPHASE, "Client connection closed.\n"); + DropClient(0); + } return; } |