summaryrefslogtreecommitdiff
path: root/usr.sbin/ppp/command.c
diff options
context:
space:
mode:
authorBrian Somers <brian@FreeBSD.org>1997-09-22 00:46:56 +0000
committerBrian Somers <brian@FreeBSD.org>1997-09-22 00:46:56 +0000
commit35495bec8dc4bde36f113ce296f7726a99f9db78 (patch)
tree468906d338f1e4de94b4c79ec9f18602e3ca1057 /usr.sbin/ppp/command.c
parentcec9e91f194d95a35156589fa8fa5476cc7a5a0c (diff)
downloadsrc-test2-35495bec8dc4bde36f113ce296f7726a99f9db78.tar.gz
src-test2-35495bec8dc4bde36f113ce296f7726a99f9db78.zip
Notes
Diffstat (limited to 'usr.sbin/ppp/command.c')
-rw-r--r--usr.sbin/ppp/command.c28
1 files changed, 11 insertions, 17 deletions
diff --git a/usr.sbin/ppp/command.c b/usr.sbin/ppp/command.c
index 950e6275f043..483a3bc5b770 100644
--- a/usr.sbin/ppp/command.c
+++ b/usr.sbin/ppp/command.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: command.c,v 1.82 1997/09/17 23:17:52 brian Exp $
+ * $Id: command.c,v 1.83 1997/09/21 13:07:57 brian Exp $
*
*/
#include <sys/types.h>
@@ -1192,17 +1192,7 @@ SetNBNS(struct cmdtab const * list, int argc, char **argv)
#endif /* MS_EXT */
-#define VAR_AUTHKEY 0
-#define VAR_DIAL 1
-#define VAR_LOGIN 2
-#define VAR_AUTHNAME 3
-#define VAR_DEVICE 4
-#define VAR_ACCMAP 5
-#define VAR_PHONE 6
-#define VAR_HANGUP 7
-#define VAR_ENC 8
-
-static int
+int
SetVariable(struct cmdtab const * list, int argc, char **argv, int param)
{
u_long map;
@@ -1231,11 +1221,15 @@ SetVariable(struct cmdtab const * list, int argc, char **argv, int param)
VarLoginScript[sizeof(VarLoginScript) - 1] = '\0';
break;
case VAR_DEVICE:
- CloseModem();
- strncpy(VarDevice, arg, sizeof(VarDevice) - 1);
- VarDevice[sizeof(VarDevice) - 1] = '\0';
- VarBaseDevice = rindex(VarDevice, '/');
- VarBaseDevice = VarBaseDevice ? VarBaseDevice + 1 : "";
+ if (modem != -1)
+ LogPrintf(LogWARN, "Cannot change device to \"%s\" when \"%s\" is open\n",
+ arg, VarDevice);
+ else {
+ strncpy(VarDevice, arg, sizeof(VarDevice) - 1);
+ VarDevice[sizeof(VarDevice) - 1] = '\0';
+ VarBaseDevice = rindex(VarDevice, '/');
+ VarBaseDevice = VarBaseDevice ? VarBaseDevice + 1 : "";
+ }
break;
case VAR_ACCMAP:
sscanf(arg, "%lx", &map);