summaryrefslogtreecommitdiff
path: root/usr.sbin/ppp/main.c
diff options
context:
space:
mode:
authorbrian <brian@cvs.openbsd.org>1997-12-27 13:45:22 +0000
committerbrian <brian@cvs.openbsd.org>1997-12-27 13:45:22 +0000
commit620782ad72dc562f184f5c57e4c66d5f16339a52 (patch)
treed6c65588447a905f2a0575966336e1c028513a82 /usr.sbin/ppp/main.c
parenta572d36d1ef4f38506baacb05686c8e7db9fd534 (diff)
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.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/usr.sbin/ppp/main.c b/usr.sbin/ppp/main.c
index 8d8b0fa96c1..45565e4a646 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.7 1997/12/24 09:30:41 brian Exp $
+ * $Id: main.c,v 1.8 1997/12/27 13:45:20 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;
}