Allow ``set authname'' in any phase, just warn if we're not
authorbrian <brian@openbsd.org>
Sun, 2 Apr 2000 01:36:25 +0000 (01:36 +0000)
committerbrian <brian@openbsd.org>
Sun, 2 Apr 2000 01:36:25 +0000 (01:36 +0000)
in DEAD or ESTABLISH.

usr.sbin/ppp/ppp/command.c

index 93dfb40..fa862fa 100644 (file)
@@ -17,7 +17,7 @@
  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
- * $OpenBSD: command.c,v 1.40 2000/03/31 14:32:50 brian Exp $
+ * $OpenBSD: command.c,v 1.41 2000/04/02 01:36:25 brian Exp $
  *
  */
 #include <sys/param.h>
@@ -1457,16 +1457,16 @@ SetVariable(struct cmdargs const *arg)
 
   case VAR_AUTHNAME:
     switch (bundle_Phase(arg->bundle)) {
+      default:
+        log_Printf(LogWARN, "Altering authname while at phase %s\n",
+                   bundle_PhaseName(arg->bundle));
+        /* drop through */
       case PHASE_DEAD:
       case PHASE_ESTABLISH:
         strncpy(arg->bundle->cfg.auth.name, argp,
                 sizeof arg->bundle->cfg.auth.name - 1);
         arg->bundle->cfg.auth.name[sizeof arg->bundle->cfg.auth.name-1] = '\0';
         break;
-      default:
-        err = "set authname: Only available at phase DEAD/ESTABLISH\n";
-        log_Printf(LogWARN, err);
-        break;
     }
     break;